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
@@ -26,15 +26,12 @@ package com.iluwatar.servicelocator;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* Application test
|
||||
*
|
||||
*/
|
||||
public class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@@ -23,14 +23,15 @@
|
||||
|
||||
package com.iluwatar.servicelocator;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Date: 12/29/15 - 19:07 PM
|
||||
*
|
||||
@@ -52,12 +53,10 @@ public class ServiceLocatorTest {
|
||||
*/
|
||||
@Test
|
||||
public void testServiceCache() {
|
||||
final String[] serviceNames = new String[]{
|
||||
"jndi/serviceA", "jndi/serviceB"
|
||||
};
|
||||
final var serviceNames = List.of("jndi/serviceA", "jndi/serviceB");
|
||||
|
||||
for (final String serviceName : serviceNames) {
|
||||
final Service service = ServiceLocator.getService(serviceName);
|
||||
for (final var serviceName : serviceNames) {
|
||||
final var service = ServiceLocator.getService(serviceName);
|
||||
assertNotNull(service);
|
||||
assertEquals(serviceName, service.getName());
|
||||
assertTrue(service.getId() > 0); // The id is generated randomly, but the minimum value is '1'
|
||||
|
Reference in New Issue
Block a user