Java 11 migrate 7 remaining f (#1115)
* Moves facade to Java 11 * Moves factory-kit to Java 11 * Moves factory-method to Java 11 * Moves feature-toggle to Java 11 * Moves fluentinterface to Java 11 * Moves flux to Java 11 * Moves flyweight to Java 11 * Moves front-controller to Java 11 * Uses stream properly * Resolves issues with ci
This commit is contained in:
committed by
Ilkka Seppälä
parent
f835d3d516
commit
670c4e43f3
facade
factory-kit/src
main
java
com
iluwatar
factorykit
test
java
com
iluwatar
factorykit
factory-method
feature-toggle/src
main
java
com
iluwatar
featuretoggle
test
java
com
iluwatar
featuretoggle
pattern
propertiesversion
tieredversion
user
fluentinterface/src
main
java
com
iluwatar
fluentinterface
app
fluentiterable
test
java
com
iluwatar
fluentinterface
flux/src
main
java
com
iluwatar
flux
test
java
com
iluwatar
flyweight
front-controller/src
main
java
com
iluwatar
front
controller
test
java
com
@@ -26,15 +26,12 @@ package com.iluwatar.front.controller;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* Application test
|
||||
*
|
||||
*/
|
||||
public class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ public class ApplicationExceptionTest {
|
||||
|
||||
@Test
|
||||
public void testCause() {
|
||||
final Exception cause = new Exception();
|
||||
final var cause = new Exception();
|
||||
assertSame(cause, new ApplicationException(cause).getCause());
|
||||
}
|
||||
|
||||
|
@@ -23,17 +23,15 @@
|
||||
|
||||
package com.iluwatar.front.controller;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.front.controller.utils.InMemoryAppender;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Date: 12/13/15 - 1:39 PM
|
||||
*
|
||||
@@ -54,11 +52,11 @@ public class CommandTest {
|
||||
}
|
||||
|
||||
static List<Object[]> dataProvider() {
|
||||
final List<Object[]> parameters = new ArrayList<>();
|
||||
parameters.add(new Object[]{"Archer", "Displaying archers"});
|
||||
parameters.add(new Object[]{"Catapult", "Displaying catapults"});
|
||||
parameters.add(new Object[]{"NonExistentCommand", "Error 500"});
|
||||
return parameters;
|
||||
return List.of(
|
||||
new Object[]{"Archer", "Displaying archers"},
|
||||
new Object[]{"Catapult", "Displaying catapults"},
|
||||
new Object[]{"NonExistentCommand", "Error 500"}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +66,7 @@ public class CommandTest {
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataProvider")
|
||||
public void testDisplay(String request, String displayMessage) {
|
||||
final FrontController frontController = new FrontController();
|
||||
final var frontController = new FrontController();
|
||||
assertEquals(0, appender.getLogSize());
|
||||
frontController.handleRequest(request);
|
||||
assertEquals(displayMessage, appender.getLastMessage());
|
||||
|
@@ -23,17 +23,15 @@
|
||||
|
||||
package com.iluwatar.front.controller;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.front.controller.utils.InMemoryAppender;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Date: 12/13/15 - 1:39 PM
|
||||
*
|
||||
@@ -54,11 +52,11 @@ public class FrontControllerTest {
|
||||
}
|
||||
|
||||
static List<Object[]> dataProvider() {
|
||||
final List<Object[]> parameters = new ArrayList<>();
|
||||
parameters.add(new Object[]{new ArcherCommand(), "Displaying archers"});
|
||||
parameters.add(new Object[]{new CatapultCommand(), "Displaying catapults"});
|
||||
parameters.add(new Object[]{new UnknownCommand(), "Error 500"});
|
||||
return parameters;
|
||||
return List.of(
|
||||
new Object[]{new ArcherCommand(), "Displaying archers"},
|
||||
new Object[]{new CatapultCommand(), "Displaying catapults"},
|
||||
new Object[]{new UnknownCommand(), "Error 500"}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,17 +23,15 @@
|
||||
|
||||
package com.iluwatar.front.controller;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.front.controller.utils.InMemoryAppender;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Date: 12/13/15 - 1:39 PM
|
||||
*
|
||||
@@ -54,11 +52,11 @@ public class ViewTest {
|
||||
}
|
||||
|
||||
static List<Object[]> dataProvider() {
|
||||
final List<Object[]> parameters = new ArrayList<>();
|
||||
parameters.add(new Object[]{new ArcherView(), "Displaying archers"});
|
||||
parameters.add(new Object[]{new CatapultView(), "Displaying catapults"});
|
||||
parameters.add(new Object[]{new ErrorView(), "Error 500"});
|
||||
return parameters;
|
||||
return List.of(
|
||||
new Object[]{new ArcherView(), "Displaying archers"},
|
||||
new Object[]{new CatapultView(), "Displaying catapults"},
|
||||
new Object[]{new ErrorView(), "Error 500"}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user