DonĀ“t assume order of auth headers in checkWWWAuthenticateHeader test
Change-Id: Ic74509fc6abe18691ea353715eb20c2693426b8e
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
index dc92a5d..c91cec8 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
@@ -1,5 +1,7 @@
package de.ids_mannheim.korap.web.controller;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -46,12 +48,9 @@
for (Entry<String, List<Object>> header : headers) {
if (header.getKey().equals(ContainerRequest.WWW_AUTHENTICATE)) {
- assertEquals("Api realm=\"Kustvakt\"",
- header.getValue().get(0));
- assertEquals("Bearer realm=\"Kustvakt\"",
- header.getValue().get(1));
- assertEquals("Basic realm=\"Kustvakt\"",
- header.getValue().get(2));
+ assertThat(header.getValue(), hasItem("Api realm=\"Kustvakt\""));
+ assertThat(header.getValue(), hasItem("Bearer realm=\"Kustvakt\""));
+ assertThat(header.getValue(), hasItem("Basic realm=\"Kustvakt\""));
}
}
}