summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/admin/monitoring/MetricSetTest.java23
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/ValidationTester.java3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTester.java3
3 files changed, 10 insertions, 19 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/monitoring/MetricSetTest.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/monitoring/MetricSetTest.java
index 8a15d87b6c5..7eec4450f33 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/admin/monitoring/MetricSetTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/monitoring/MetricSetTest.java
@@ -1,11 +1,10 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.monitoring;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import org.junit.jupiter.api.Test;
+import java.util.List;
import java.util.Map;
import static java.util.Collections.emptyList;
@@ -19,9 +18,9 @@ public class MetricSetTest {
@Test
void metrics_from_children_are_added() {
- MetricSet child1 = new MetricSet("child1", ImmutableList.of(new Metric("child1_metric")));
- MetricSet child2 = new MetricSet("child2", ImmutableList.of(new Metric("child2_metric")));
- MetricSet parent = new MetricSet("parent", emptyList(), ImmutableList.of(child1, child2));
+ MetricSet child1 = new MetricSet("child1", List.of(new Metric("child1_metric")));
+ MetricSet child2 = new MetricSet("child2", List.of(new Metric("child2_metric")));
+ MetricSet parent = new MetricSet("parent", emptyList(), List.of(child1, child2));
Map<String, Metric> parentMetrics = parent.getMetrics();
assertEquals(2, parentMetrics.size());
@@ -31,8 +30,8 @@ public class MetricSetTest {
@Test
void adding_the_same_child_set_twice_has_no_effect() {
- MetricSet child = new MetricSet("child", ImmutableList.of(new Metric("child_metric")));
- MetricSet parent = new MetricSet("parent", emptyList(), ImmutableList.of(child, child));
+ MetricSet child = new MetricSet("child", List.of(new Metric("child_metric")));
+ MetricSet parent = new MetricSet("parent", emptyList(), List.of(child, child));
Map<String, Metric> parentMetrics = parent.getMetrics();
assertEquals(1, parentMetrics.size());
@@ -44,16 +43,10 @@ public class MetricSetTest {
String METRIC_NAME = "metric1";
String COMMON_DIMENSION_KEY = "commonKey";
- Map<String, String> childDimensions = ImmutableMap.<String, String>builder()
- .put(COMMON_DIMENSION_KEY, "childCommonVal")
- .put("childKey", "childVal")
- .build();
+ Map<String, String> childDimensions = Map.of(COMMON_DIMENSION_KEY, "childCommonVal", "childKey", "childVal");
Metric childMetric = new Metric(METRIC_NAME, "child-output-name", "child-description", childDimensions);
- Map<String, String> parentDimensions = ImmutableMap.<String, String>builder()
- .put(COMMON_DIMENSION_KEY, "parentCommonVal")
- .put("parentKey", "parentVal")
- .build();
+ Map<String, String> parentDimensions = Map.of(COMMON_DIMENSION_KEY, "parentCommonVal","parentKey", "parentVal");
Metric parentMetric = new Metric(METRIC_NAME, "parent-output-name", "parent-description", parentDimensions);
MetricSet child = new MetricSet("set1", Sets.newHashSet(childMetric));
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ValidationTester.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ValidationTester.java
index a7f3d134b57..cb535380b18 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ValidationTester.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ValidationTester.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.application.validation;
-import com.google.common.collect.ImmutableList;
import com.yahoo.collections.Pair;
import com.yahoo.config.application.api.ApplicationPackage;
import com.yahoo.config.model.api.ConfigChangeAction;
@@ -77,7 +76,7 @@ public class ValidationTester {
Provisioned provisioned = hostProvisioner.startProvisionedRecording();
ApplicationPackage newApp = new MockApplicationPackage.Builder()
.withServices(services)
- .withSchemas(ImmutableList.of(MUSIC_SCHEMA, BOOK_SCHEMA))
+ .withSchemas(List.of(MUSIC_SCHEMA, BOOK_SCHEMA))
.withValidationOverrides(validationOverrides)
.build();
VespaModelCreatorWithMockPkg newModelCreator = new VespaModelCreatorWithMockPkg(newApp);
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTester.java b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTester.java
index ed0cedd4e87..a31d4cd4e20 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTester.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTester.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.test;
-import com.google.common.collect.ImmutableList;
import com.yahoo.config.application.api.ApplicationPackage;
import com.yahoo.config.model.ConfigModelRegistry;
import com.yahoo.config.model.NullConfigModelRegistry;
@@ -90,7 +89,7 @@ public class VespaModelTester {
"-" + Math.round(resources.memoryGb()) +
"-" + Math.round(resources.diskGb()),
count - i);
- hosts.add(new Host(hostname, ImmutableList.of(), flavor));
+ hosts.add(new Host(hostname, List.of(), flavor));
}
this.hostsByResources.put(resources, hosts);