diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:30:35 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:39:04 +0200 |
commit | 76a89b62274060452022ddf24a7685ee2f380cb4 (patch) | |
tree | ef924603de22efd026f519ab31fd8f5a6ff60f2f /standalone-container | |
parent | 7e7ebf7b527be1f163d497a41898e2252d878fe7 (diff) |
Replace all usages of Arrays.asList with List.of where possible.
Diffstat (limited to 'standalone-container')
2 files changed, 2 insertions, 4 deletions
diff --git a/standalone-container/src/test/java/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.java b/standalone-container/src/test/java/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.java index 72f32ac04b8..9cd48ac85a8 100644 --- a/standalone-container/src/test/java/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.java +++ b/standalone-container/src/test/java/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.java @@ -6,7 +6,6 @@ import org.junit.Test; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; import static com.yahoo.container.standalone.CloudConfigInstallVariables.toConfigModelsPluginDir; import static com.yahoo.container.standalone.CloudConfigInstallVariables.toConfigServer; @@ -39,7 +38,7 @@ public class CloudConfigInstallVariablesTest { assertEquals(2, parsed.length); List<String> hostNames = Arrays.stream(parsed).map(cs -> cs.hostName).toList(); - assertTrue(hostNames.containsAll(Arrays.asList("test1", "test2"))); + assertTrue(hostNames.containsAll(List.of("test1", "test2"))); } @Test(expected = IllegalArgumentException.class) diff --git a/standalone-container/src/test/java/com/yahoo/container/standalone/StandaloneContainer.java b/standalone-container/src/test/java/com/yahoo/container/standalone/StandaloneContainer.java index 8d207388b42..00430e04858 100644 --- a/standalone-container/src/test/java/com/yahoo/container/standalone/StandaloneContainer.java +++ b/standalone-container/src/test/java/com/yahoo/container/standalone/StandaloneContainer.java @@ -11,7 +11,6 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; import java.util.List; /** @@ -51,7 +50,7 @@ public class StandaloneContainer { private static void writeServicesXml(Path applicationPath, String servicesXml) throws IOException { Path path = applicationPath.resolve("services.xml"); - List<String> output = Arrays.asList("<?xml version=\"1.0\" encoding=\"utf-8\"?>", servicesXml); + List<String> output = List.of("<?xml version=\"1.0\" encoding=\"utf-8\"?>", servicesXml); Files.write(path, output, StandardCharsets.UTF_8); } } |