Enabled definition of multiple license regex in kustvakt.conf.
Change-Id: I1ca43049de8b9a8994bd7451c8c65e94841b40f7
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
index de7e93d..376bcfb 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
@@ -155,7 +155,8 @@
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("CC-BY.*",
node.at("/collection/operands/0/value").asText());
- assertEquals("ACA.*", node.at("/collection/operands/1/value").asText());
+ assertEquals("ACA.*", node.at("/collection/operands/1/operands/0/value").asText());
+ assertEquals("QAO-NC", node.at("/collection/operands/1/operands/1/value").asText());
assertEquals("operation:or", node.at("/collection/operation").asText());
assertEquals("availability(PUB)",
node.at("/collection/rewrites/0/scope").asText());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
index 5bc1ac4..dad8f99 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
@@ -55,9 +55,13 @@
assertEquals("CC-BY.*",
node.at("/collection/operands/0/operands/0/value").asText());
assertEquals("match:eq",
- node.at("/collection/operands/0/operands/1/match").asText());
+ node.at("/collection/operands/0/operands/1/operands/0/match").asText());
assertEquals("ACA.*",
- node.at("/collection/operands/0/operands/1/value").asText());
+ node.at("/collection/operands/0/operands/1/operands/0/value").asText());
+ assertEquals("match:eq",
+ node.at("/collection/operands/0/operands/1/operands/1/match").asText());
+ assertEquals("QAO-NC",
+ node.at("/collection/operands/0/operands/1/operands/1/value").asText());
assertEquals("operation:insertion",
node.at("/collection/rewrites/0/operation").asText());
assertEquals("availability(PUB)",
@@ -94,12 +98,12 @@
node.at("/operands/0/value").asText());
assertEquals("match:eq",
- node.at("/operands/1/match").asText());
+ node.at("/operands/1/operands/0/match").asText());
assertEquals("type:regex",
- node.at("/operands/1/type").asText());
+ node.at("/operands/1/operands/0/type").asText());
assertEquals("availability",
- node.at("/operands/1/key").asText());
- assertEquals("ACA.*", node.at("/operands/1/value").asText());
+ node.at("/operands/1/operands/0/key").asText());
+ assertEquals("ACA.*", node.at("/operands/1/operands/0/value").asText());
}
@@ -162,9 +166,13 @@
assertEquals("CC-BY.*",
node.at("/operands/0/value").asText());
assertEquals("match:eq",
- node.at("/operands/1/operands/1/match").asText());
+ node.at("/operands/1/operands/1/operands/0/match").asText());
+ assertEquals("QAO-NC",
+ node.at("/operands/1/operands/1/operands/0/value").asText());
+ assertEquals("match:eq",
+ node.at("/operands/1/operands/1/operands/1/match").asText());
assertEquals("QAO.*",
- node.at("/operands/1/operands/1/value").asText());
+ node.at("/operands/1/operands/1/operands/1/value").asText());
}
diff --git a/full/src/test/resources/kustvakt-test.conf b/full/src/test/resources/kustvakt-test.conf
index 04e00b8..b16b08e 100644
--- a/full/src/test/resources/kustvakt-test.conf
+++ b/full/src/test/resources/kustvakt-test.conf
@@ -24,7 +24,7 @@
## availability regex
availability.regex.free = CC-BY.*
-availability.regex.public = ACA.*
+availability.regex.public = ACA.* | QAO-NC
availability.regex.all = QAO.*
kustvakt.management.registration=enable