diff options
author | gjoranv <gv@yahoo-inc.com> | 2017-02-03 20:07:13 +0100 |
---|---|---|
committer | gjoranv <gv@yahoo-inc.com> | 2017-02-03 20:07:13 +0100 |
commit | a6e35cd34b34ac978c08214c0de7fcdf10c46230 (patch) | |
tree | 812955a81be095125ff43771307c8ccd60adf678 /config-model | |
parent | 43802b8467514ba10adb48d71d6461ba26ed7370 (diff) |
Improve test.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/container/xml/AccessControlTest.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/AccessControlTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/AccessControlTest.java index 86a1af02615..fcc9fc1d29e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/AccessControlTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/AccessControlTest.java @@ -29,13 +29,13 @@ public class AccessControlTest extends ContainerModelBuilderTestBase { private static final Set<String> REQUIRED_BINDINGS = ImmutableSet.of( "/custom-handler/", "/search/", - "/feed", - "/remove", - "/removelocation", - "/get", - "/visit", - "/document", - "/feedstatus", + "/feed/", + "/remove/", + "/removelocation/", + "/get/", + "/visit/", + "/document/", + "/feedstatus/", ContainerCluster.RESERVED_URI_PREFIX); private static final Set<String> FORBIDDEN_BINDINGS = ImmutableSet.of( @@ -95,14 +95,12 @@ public class AccessControlTest extends ContainerModelBuilderTestBase { .collect(Collectors.toSet()); Set<String> missingRequiredBindings = new HashSet<>(REQUIRED_BINDINGS); missingRequiredBindings.removeAll(foundRequiredBindings); - assertTrue("Access control chain was not bound to: " + CollectionUtil.mkString(REQUIRED_BINDINGS, ", "), + assertTrue("Access control chain was not bound to: " + CollectionUtil.mkString(missingRequiredBindings, ", "), missingRequiredBindings.isEmpty()); - for (String forbiddenBinding : FORBIDDEN_BINDINGS) { - for (Binding binding : http.getBindings()) - assertFalse("Access control chain was bound to: ", - binding.binding.contains(forbiddenBinding)); - } + FORBIDDEN_BINDINGS.forEach(forbiddenBinding -> http.getBindings().forEach( + binding -> assertFalse("Access control chain was bound to: " + binding.binding, + binding.binding.contains(forbiddenBinding)))); } private boolean containsBinding(Collection<Binding> bindings, String binding) { |