mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 18:59:21 +00:00
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:
@@ -97,7 +97,7 @@ class CreatureTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidDamageTest(){
|
||||
void invalidDamageTest() {
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> elf.hit(-50));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,12 +32,11 @@ class ExceptionsTest {
|
||||
private static final String MSG = "test";
|
||||
|
||||
@Test
|
||||
void testException(){
|
||||
void testException() {
|
||||
Exception e;
|
||||
try{
|
||||
try {
|
||||
throw new LockingException(MSG);
|
||||
}
|
||||
catch(LockingException ex){
|
||||
} catch (LockingException ex) {
|
||||
e = ex;
|
||||
}
|
||||
Assertions.assertEquals(MSG, e.getMessage());
|
||||
|
||||
@@ -39,14 +39,14 @@ class FeindTest {
|
||||
private Lockable sword;
|
||||
|
||||
@BeforeEach
|
||||
void init(){
|
||||
void init() {
|
||||
elf = new Elf("Nagdil");
|
||||
orc = new Orc("Ghandar");
|
||||
sword = new SwordOfAragorn();
|
||||
}
|
||||
|
||||
@Test
|
||||
void nullTests(){
|
||||
void nullTests() {
|
||||
Assertions.assertThrows(NullPointerException.class, () -> new Feind(null, null));
|
||||
Assertions.assertThrows(NullPointerException.class, () -> new Feind(elf, null));
|
||||
Assertions.assertThrows(NullPointerException.class, () -> new Feind(null, sword));
|
||||
@@ -67,5 +67,4 @@ class FeindTest {
|
||||
sword.unlock(elf.isAlive() ? elf : orc);
|
||||
Assertions.assertNull(sword.getLocker());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
|
||||
class SubCreaturesTests {
|
||||
|
||||
@Test
|
||||
void statsTest(){
|
||||
void statsTest() {
|
||||
var elf = new Elf("Limbar");
|
||||
var orc = new Orc("Dargal");
|
||||
var human = new Human("Jerry");
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class TheSwordOfAragornTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidLockerTest(){
|
||||
void invalidLockerTest() {
|
||||
var sword = new SwordOfAragorn();
|
||||
Assertions.assertThrows(NullPointerException.class, () -> sword.lock(null));
|
||||
Assertions.assertThrows(NullPointerException.class, () -> sword.unlock(null));
|
||||
|
||||
Reference in New Issue
Block a user