Java 11 migrate all remaining s (#1120)
* Moves saga to Java 11 * Moves semaphore to Java 11 * Moves servant to Java 11 * Moves serverless to Java 11 * Moves service-layer to Java 11 * Moves service-locator to Java 11 * Moves sharding to Java 11 * Moves singleton to Java 11 * Moves spatial-partition to Java 11 * Moves specification to Java 11 * Moves state to Java 11 * Moves step-builder to Java 11 * Moves strategy to Java 11 * Moves subclass-sandbox to Java 11 * Fixes checkstyle issues
This commit is contained in:
committed by
Ilkka Seppälä
parent
310ae50248
commit
cd2a2e7711
@ -32,7 +32,6 @@ public class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ public class DragonSlayerTest {
|
||||
*/
|
||||
@Test
|
||||
public void testGoToBattle() {
|
||||
final DragonSlayingStrategy strategy = mock(DragonSlayingStrategy.class);
|
||||
final DragonSlayer dragonSlayer = new DragonSlayer(strategy);
|
||||
final var strategy = mock(DragonSlayingStrategy.class);
|
||||
final var dragonSlayer = new DragonSlayer(strategy);
|
||||
|
||||
dragonSlayer.goToBattle();
|
||||
verify(strategy).execute();
|
||||
@ -54,13 +54,13 @@ public class DragonSlayerTest {
|
||||
*/
|
||||
@Test
|
||||
public void testChangeStrategy() {
|
||||
final DragonSlayingStrategy initialStrategy = mock(DragonSlayingStrategy.class);
|
||||
final DragonSlayer dragonSlayer = new DragonSlayer(initialStrategy);
|
||||
final var initialStrategy = mock(DragonSlayingStrategy.class);
|
||||
final var dragonSlayer = new DragonSlayer(initialStrategy);
|
||||
|
||||
dragonSlayer.goToBattle();
|
||||
verify(initialStrategy).execute();
|
||||
|
||||
final DragonSlayingStrategy newStrategy = mock(DragonSlayingStrategy.class);
|
||||
final var newStrategy = mock(DragonSlayingStrategy.class);
|
||||
dragonSlayer.changeStrategy(newStrategy);
|
||||
|
||||
dragonSlayer.goToBattle();
|
||||
|
@ -28,11 +28,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.AppenderBase;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
@ -53,18 +51,18 @@ public class DragonSlayingStrategyTest {
|
||||
*/
|
||||
static Collection<Object[]> dataProvider() {
|
||||
return List.of(
|
||||
new Object[]{
|
||||
new MeleeStrategy(),
|
||||
"With your Excalibur you sever the dragon's head!"
|
||||
},
|
||||
new Object[]{
|
||||
new ProjectileStrategy(),
|
||||
"You shoot the dragon with the magical crossbow and it falls dead on the ground!"
|
||||
},
|
||||
new Object[]{
|
||||
new SpellStrategy(),
|
||||
"You cast the spell of disintegration and the dragon vaporizes in a pile of dust!"
|
||||
}
|
||||
new Object[]{
|
||||
new MeleeStrategy(),
|
||||
"With your Excalibur you sever the dragon's head!"
|
||||
},
|
||||
new Object[]{
|
||||
new ProjectileStrategy(),
|
||||
"You shoot the dragon with the magical crossbow and it falls dead on the ground!"
|
||||
},
|
||||
new Object[]{
|
||||
new SpellStrategy(),
|
||||
"You cast the spell of disintegration and the dragon vaporizes in a pile of dust!"
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user