From 5858a6cdae398b95360c5d031e56037799930895 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 11 Aug 2020 23:29:08 +0200 Subject: Revert "Reduce the use of hamcrest when normal assertEquals/assertTrue does a…" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chain/pom.xml | 5 +++++ .../com/yahoo/component/chain/model/ChainsModelBuilderTest.java | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'chain') diff --git a/chain/pom.xml b/chain/pom.xml index 67ee1a4c0e7..2ead24a89b7 100755 --- a/chain/pom.xml +++ b/chain/pom.xml @@ -25,6 +25,11 @@ junit test + + org.hamcrest + hamcrest-library + test + com.yahoo.vespa provided-dependencies diff --git a/chain/src/test/java/com/yahoo/component/chain/model/ChainsModelBuilderTest.java b/chain/src/test/java/com/yahoo/component/chain/model/ChainsModelBuilderTest.java index 7cef03bbb06..2a22b5afbf7 100644 --- a/chain/src/test/java/com/yahoo/component/chain/model/ChainsModelBuilderTest.java +++ b/chain/src/test/java/com/yahoo/component/chain/model/ChainsModelBuilderTest.java @@ -11,7 +11,8 @@ import java.util.Set; import static com.yahoo.container.core.ChainsConfig.Components; import static com.yahoo.container.core.ChainsConfig.Chains; -import static org.junit.Assert.assertEquals; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; /** @@ -22,7 +23,7 @@ public class ChainsModelBuilderTest { @Test public void components_are_added_to_componentModels() throws Exception { ChainsModel model = chainsModel(); - assertEquals(2, model.allComponents().size()); + assertThat(model.allComponents().size(), is(2)); assertTrue(model.componentModels().containsKey(new ComponentId("componentA"))); } @@ -37,7 +38,7 @@ public class ChainsModelBuilderTest { public void inherited_chains_are_added_to_chainSpecification() throws Exception { ChainsModel model = chainsModel(); ChainSpecification inheritsChain1 = model.chainSpecifications().get(new ComponentId("inheritsChain1")).model(); - assertEquals(2, model.allChainsFlattened().size()); + assertThat(model.allChainsFlattened().size(), is(2)); assertTrue(getComponentsByName(inheritsChain1.inheritance.chainSpecifications).containsKey("chain1")); assertTrue(getComponentsByName(inheritsChain1.inheritance.excludedComponents).containsKey("componentA")); } -- cgit v1.2.3