diff options
Diffstat (limited to 'orchestrator')
2 files changed, 13 insertions, 13 deletions
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java index 7dccaad1b1c..db5beafac81 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java @@ -28,7 +28,6 @@ import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Optional; @@ -73,7 +72,7 @@ public class ClusterApiImplTest { modelUtils.createServiceInstance("service-5", hostName5, ServiceStatus.UP) ) ); - modelUtils.createApplicationInstance(Collections.singletonList(serviceCluster)); + modelUtils.createApplicationInstance(List.of(serviceCluster)); modelUtils.createNode(hostName1, HostStatus.NO_REMARKS); modelUtils.createNode(hostName2, HostStatus.NO_REMARKS); @@ -278,7 +277,7 @@ public class ClusterApiImplTest { service6 ) ); - modelUtils.createApplicationInstance(Collections.singletonList(serviceCluster)); + modelUtils.createApplicationInstance(List.of(serviceCluster)); modelUtils.createNode(hostName1, HostStatus.NO_REMARKS); modelUtils.createNode(hostName2, HostStatus.NO_REMARKS); diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java index 6a2783949d8..53192b1d40e 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java @@ -53,7 +53,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.time.Clock; import java.time.Instant; -import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; @@ -278,7 +278,7 @@ class HostRequestHandlerTest { ServiceCluster serviceCluster = new ServiceCluster( new ClusterId("clusterId"), new ServiceType("serviceType"), - Collections.singleton(serviceInstance)); + Set.of(serviceInstance)); serviceInstance.setServiceCluster(serviceCluster); Host host = new Host( @@ -287,7 +287,7 @@ class HostRequestHandlerTest { new ApplicationInstanceReference( new TenantId("tenantId"), new ApplicationInstanceId("applicationId")), - Collections.singletonList(serviceInstance)); + List.of(serviceInstance)); when(orchestrator.getHost(hostName)).thenReturn(host); HttpResponse httpResponse = executeRequest(testDriver, Method.GET, "/orchestrator/v1/hosts/hostname", null); @@ -314,13 +314,14 @@ class HostRequestHandlerTest { assertEquals(409, httpResponse.getStatus()); ByteArrayOutputStream out = new ByteArrayOutputStream(); httpResponse.render(out); - JsonTestHelper.assertJsonEquals("{\n" + - " \"hostname\" : \"hostname\",\n" + - " \"reason\" : {\n" + - " \"constraint\" : \"deadline\",\n" + - " \"message\" : \"resume failed: Timeout Message\"\n" + - " }\n" + - "}", + JsonTestHelper.assertJsonEquals(""" + { + "hostname" : "hostname", + "reason" : { + "constraint" : "deadline", + "message" : "resume failed: Timeout Message" + } + }""", out.toString()); } |