diff options
author | gjoranv <gv@verizonmedia.com> | 2021-09-17 10:40:50 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2021-09-23 15:46:04 +0200 |
commit | 4d21c53e72e87db23c3ce528f38ee3ce962660ef (patch) | |
tree | 96cc8b487ca0a8888048a168b127a0780b699579 /config-model | |
parent | 65a48c1c858f99b229c5809e5cc2f0038f3f1b86 (diff) |
Make unit tests robust agains changes in platform bundles.
Diffstat (limited to 'config-model')
2 files changed, 3 insertions, 7 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java index 413daefdf75..4359e90e8a2 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerClusterTest.java @@ -51,8 +51,7 @@ public class MetricsProxyContainerClusterTest { var builder = new PlatformBundlesConfig.Builder(); model.getConfig(builder, CLUSTER_CONFIG_ID); PlatformBundlesConfig config = builder.build(); - assertEquals(1, config.bundlePaths().size()); - assertThat(config.bundlePaths(0), endsWith(METRICS_PROXY_BUNDLE_FILE.toString())); + assertThat(config.bundlePaths(), hasItem(endsWith(METRICS_PROXY_BUNDLE_FILE.toString()))); } @Test diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java index dd4f4c3b7d5..a66ea736a5b 100755 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java @@ -38,8 +38,8 @@ import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; +import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasKey; -import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; @@ -383,10 +383,7 @@ public class ContainerClusterTest { cluster.getConfig(bundleBuilder); List<String> installedBundles = bundleBuilder.build().bundlePaths(); - assertEquals(expectedBundleNames.size(), installedBundles.size()); - assertThat(installedBundles, containsInAnyOrder( - expectedBundleNames.stream().map(CoreMatchers::endsWith).collect(Collectors.toList()) - )); + expectedBundleNames.forEach(b -> assertThat(installedBundles, hasItem(CoreMatchers.endsWith(b)))); } |