From 82bec7525152889f4679bf62ffe71d48e4a303d4 Mon Sep 17 00:00:00 2001 From: Øyvind Grønnesby Date: Wed, 19 Jun 2019 09:48:45 +0200 Subject: Use assumeTrue/assumeFalse on the tests instead of if () --- .../config/server/model/LbServicesProducerTest.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'configserver') diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java index 1287bce4963..1f99f59eb8e 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java @@ -39,6 +39,8 @@ import java.util.Set; import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; +import static org.junit.Assume.assumeFalse; +import static org.junit.Assume.assumeTrue; /** * @author Ulf Lilleengen @@ -139,6 +141,8 @@ public class LbServicesProducerTest { @Test public void testConfigAliasesWithRotations() throws IOException, SAXException { + assumeTrue(useGlobalServiceId); + Map> testModel = createTestModel(new DeployState.Builder() .rotations(rotations) .properties(new TestProperties().setHostedVespa(true))); @@ -150,14 +154,14 @@ public class LbServicesProducerTest { .hosts("foo.foo.yahoo.com") .services(QRSERVER.serviceName); - if (useGlobalServiceId) { - assertThat(services.servicealiases(), contains("service1")); - assertThat("Missing rotations in list: " + services.endpointaliases(), services.endpointaliases(), containsInAnyOrder("foo1.bar1.com", "foo2.bar2.com", rotation1, rotation2)); - } + assertThat(services.servicealiases(), contains("service1")); + assertThat("Missing rotations in list: " + services.endpointaliases(), services.endpointaliases(), containsInAnyOrder("foo1.bar1.com", "foo2.bar2.com", rotation1, rotation2)); } @Test public void testConfigAliasesWithEndpoints() throws IOException, SAXException { + assumeFalse(useGlobalServiceId); + Map> testModel = createTestModel(new DeployState.Builder() .endpoints(endpoints) .properties(new TestProperties().setHostedVespa(true))); @@ -169,10 +173,8 @@ public class LbServicesProducerTest { .hosts("foo.foo.yahoo.com") .services(QRSERVER.serviceName); - if (! useGlobalServiceId) { - assertThat(services.servicealiases(), contains("service1")); - assertThat("Missing endpoints in list: " + services.endpointaliases(), services.endpointaliases(), containsInAnyOrder("foo1.bar1.com", "foo2.bar2.com", rotation1, rotation2)); - } + assertThat(services.servicealiases(), contains("service1")); + assertThat("Missing endpoints in list: " + services.endpointaliases(), services.endpointaliases(), containsInAnyOrder("foo1.bar1.com", "foo2.bar2.com", rotation1, rotation2)); } private Map> randomizeApplications(Map> testModel, int seed) { -- cgit v1.2.3