deps: Refactor dependencies (#3224)

* remove spring dep
move junit, logging, mockito under dep mgmt

* upgrade anti-corruption-layer deps

* async method invocation

* balking, bloc

* bridge to bytecode

* caching

* callback - cqrs

* component - health check

* hexagonal - metadata mapping

* rest of the patterns

* remove checkstyle, take spotless into use
This commit is contained in:
Ilkka Seppälä
2025-03-29 19:34:27 +02:00
committed by GitHub
parent 371439aeaa
commit 0ca162a55c
1863 changed files with 14403 additions and 17632 deletions
@@ -27,17 +27,18 @@ package com.iluwatar.subclasssandbox;
import lombok.extern.slf4j.Slf4j;
/**
* The subclass sandbox pattern describes a basic idea, while not having a lot
* of detailed mechanics. You will need the pattern when you have several similar
* subclasses. If you have to make a tiny change, then change the base class,
* while all subclasses shouldn't have to be touched. So the base class has to be
* able to provide all the operations a derived class needs to perform.
* The subclass sandbox pattern describes a basic idea, while not having a lot of detailed
* mechanics. You will need the pattern when you have several similar subclasses. If you have to
* make a tiny change, then change the base class, while all subclasses shouldn't have to be
* touched. So the base class has to be able to provide all the operations a derived class needs to
* perform.
*/
@Slf4j
public class App {
/**
* Entry point of the main program.
*
* @param args Program runtime arguments.
*/
public static void main(String[] args) {
@@ -48,5 +49,4 @@ public class App {
var groundDive = new GroundDive();
groundDive.activate();
}
}
@@ -26,9 +26,7 @@ package com.iluwatar.subclasssandbox;
import org.slf4j.LoggerFactory;
/**
* GroundDive superpower.
*/
/** GroundDive superpower. */
public class GroundDive extends Superpower {
public GroundDive() {
@@ -26,9 +26,7 @@ package com.iluwatar.subclasssandbox;
import org.slf4j.LoggerFactory;
/**
* SkyLaunch superpower.
*/
/** SkyLaunch superpower. */
public class SkyLaunch extends Superpower {
public SkyLaunch() {
@@ -27,21 +27,22 @@ package com.iluwatar.subclasssandbox;
import org.slf4j.Logger;
/**
* Superpower abstract class. In this class the basic operations of all types of
* superpowers are provided as protected methods.
* Superpower abstract class. In this class the basic operations of all types of superpowers are
* provided as protected methods.
*/
public abstract class Superpower {
protected Logger logger;
/**
* Subclass of superpower should implement this sandbox method by calling the
* methods provided in this super class.
* Subclass of superpower should implement this sandbox method by calling the methods provided in
* this super class.
*/
protected abstract void activate();
/**
* Move to (x, y, z).
*
* @param x X coordinate.
* @param y Y coordinate.
* @param z Z coordinate.
@@ -52,6 +53,7 @@ public abstract class Superpower {
/**
* Play sound effect for the superpower.
*
* @param soundName Sound name.
* @param volume Value of volume.
*/
@@ -61,6 +63,7 @@ public abstract class Superpower {
/**
* Spawn particles for the superpower.
*
* @param particleType Particle type.
* @param count Count of particles to be spawned.
*/
@@ -28,13 +28,11 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import org.junit.jupiter.api.Test;
/**
* App unit tests.
*/
/** App unit tests. */
class AppTest {
@Test
void shouldExecuteWithoutException() {
assertDoesNotThrow(() -> App.main(new String[]{}));
assertDoesNotThrow(() -> App.main(new String[] {}));
}
}
@@ -30,9 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import com.github.stefanbirkner.systemlambda.Statement;
import org.junit.jupiter.api.Test;
/**
* GroundDive unit tests.
*/
/** GroundDive unit tests. */
class GroundDiveTest {
@Test
@@ -55,8 +53,7 @@ class GroundDiveTest {
@Test
void testSpawnParticles() throws Exception {
var groundDive = new GroundDive();
final var outputLog = getLogContent(
() -> groundDive.spawnParticles("PARTICLE_TYPE", 100));
final var outputLog = getLogContent(() -> groundDive.spawnParticles("PARTICLE_TYPE", 100));
final var expectedLog = "Spawn 100 particle with type PARTICLE_TYPE";
assertEquals(outputLog, expectedLog);
}
@@ -64,8 +61,7 @@ class GroundDiveTest {
@Test
void testActivate() throws Exception {
var groundDive = new GroundDive();
var logs = tapSystemOutNormalized(groundDive::activate)
.split("\n");
var logs = tapSystemOutNormalized(groundDive::activate).split("\n");
final var expectedSize = 3;
final var log1 = logs[0].split("--")[1].trim();
final var expectedLog1 = "Move to ( 0.0, 0.0, -20.0 )";
@@ -87,5 +83,4 @@ class GroundDiveTest {
private String getLogContent(String log) {
return log.split("--")[1].trim();
}
}
@@ -30,9 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import com.github.stefanbirkner.systemlambda.Statement;
import org.junit.jupiter.api.Test;
/**
* SkyLaunch unit tests.
*/
/** SkyLaunch unit tests. */
class SkyLaunchTest {
@Test
@@ -54,8 +52,7 @@ class SkyLaunchTest {
@Test
void testSpawnParticles() throws Exception {
var skyLaunch = new SkyLaunch();
var outputLog = getLogContent(
() -> skyLaunch.spawnParticles("PARTICLE_TYPE", 100));
var outputLog = getLogContent(() -> skyLaunch.spawnParticles("PARTICLE_TYPE", 100));
var expectedLog = "Spawn 100 particle with type PARTICLE_TYPE";
assertEquals(outputLog, expectedLog);
}
@@ -63,8 +60,7 @@ class SkyLaunchTest {
@Test
void testActivate() throws Exception {
var skyLaunch = new SkyLaunch();
var logs = tapSystemOutNormalized(skyLaunch::activate)
.split("\n");
var logs = tapSystemOutNormalized(skyLaunch::activate).split("\n");
final var expectedSize = 3;
final var log1 = getLogContent(logs[0]);
final var expectedLog1 = "Move to ( 0.0, 0.0, 20.0 )";