From 18a88e91f68e98f5742de14160c4ab0aca542a01 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Thu, 3 Oct 2019 15:33:33 +0200 Subject: Remove redundant tests --- .../api/DeploymentSpecWithoutInstanceTest.java | 44 ---------------------- 1 file changed, 44 deletions(-) (limited to 'config-model-api') diff --git a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java index 7fd124ca70f..308bce78179 100644 --- a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java @@ -493,28 +493,6 @@ public class DeploymentSpecWithoutInstanceTest { assertEquals(Set.of(RegionName.from("us-east")), spec.endpoints().get(0).regions()); } - @Test - public void invalidEndpoints() { - assertInvalid(""); // Uppercase - assertInvalid(""); // Starting with non-character - assertInvalid(""); // Non-alphanumeric - assertInvalid(""); - assertInvalid(""); // Multiple consecutive dashes - assertInvalid(""); // Trailing dash - assertInvalid(""); // Too long - assertInvalid(""); // Duplicate - } - - @Test - public void validEndpoints() { - assertEquals(List.of("default"), endpointIds("")); - assertEquals(List.of("default"), endpointIds("")); - assertEquals(List.of("f"), endpointIds("")); - assertEquals(List.of("foo"), endpointIds("")); - assertEquals(List.of("foo-bar"), endpointIds("")); - assertEquals(List.of("foo", "bar"), endpointIds("")); - assertEquals(List.of("fooooooooooo"), endpointIds("")); - } @Test public void endpointDefaultRegions() { @@ -538,13 +516,6 @@ public class DeploymentSpecWithoutInstanceTest { assertEquals(Set.of("us-east", "us-west"), endpointRegions("default", spec)); } - private static void assertInvalid(String endpointTag) { - try { - endpointIds(endpointTag); - fail("Expected exception for input '" + endpointTag + "'"); - } catch (IllegalArgumentException ignored) {} - } - private static Set endpointRegions(String endpointId, DeploymentSpec spec) { return spec.endpoints().stream() .filter(endpoint -> endpoint.endpointId().equals(endpointId)) @@ -553,19 +524,4 @@ public class DeploymentSpecWithoutInstanceTest { .collect(Collectors.toSet()); } - private static List endpointIds(String endpointTag) { - var xml = "" + - " " + - " us-east" + - " " + - " " + - endpointTag + - " " + - ""; - - return DeploymentSpec.fromXml(xml).endpoints().stream() - .map(Endpoint::endpointId) - .collect(Collectors.toList()); - } - } -- cgit v1.2.3