summaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2024-04-11 23:13:46 +0200
committerGitHub <noreply@github.com>2024-04-11 23:13:46 +0200
commit7e7ebf7b527be1f163d497a41898e2252d878fe7 (patch)
tree879722e0afee0c88ad22344000c1567d79d741fa /orchestrator
parenta6fe59bf11e974b409caf73ac606ba750f45db8e (diff)
parent2d6bbe0b8bff09d105b77161c1d26a00ce43bf0c (diff)
Merge pull request #30891 from vespa-engine/balder/list-dot-of
Unify on List.of
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java5
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java21
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());
}