Introduced APIDeprecationFilter (#759)
Deprecated matchInfo web-service has been removed for API v1.1. It is
still accessible as long as v1.0 is supported on a Kustvakt server.
Change-Id: I382fd3f6200c32420dd0d88cfe5ad05e2de289e2
diff --git a/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java b/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
index 4334b97..9f0c3cb 100644
--- a/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
@@ -23,7 +23,8 @@
@ContextConfiguration("classpath:test-config.xml")
public abstract class SpringJerseyTest extends JerseyTest {
- public final static String API_VERSION = "v1.0";
+ public final static String API_VERSION = "v1.1";
+ public final static String API_VERSION_V1_0 = "v1.0";
protected final static String allCorpusAccess = "All corpus access policy "
+ "has been added.";
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
index 2f3f74d..41b27f7 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
@@ -55,8 +55,8 @@
}
@Test
- public void testUsingDeprecatedMatchInfoService () throws KustvaktException {
- Response response = target().path(API_VERSION).path("corpus")
+ public void testDeprecatedMatchInfoWithV1_0 () throws KustvaktException {
+ Response response = target().path(API_VERSION_V1_0).path("corpus")
.path("GOE").path("AGA").path("01784").path("p36-100")
.path("matchInfo")
.queryParam("foundry", "*").request().get();
@@ -70,6 +70,15 @@
+ "{textId}/{matchId}",
node.at("/warnings/0/1").asText());
}
+
+ @Test
+ public void testDeprecatedMatchInfo () throws KustvaktException {
+ Response response = target().path(API_VERSION).path("corpus")
+ .path("GOE").path("AGA").path("01784").path("p36-100")
+ .path("matchInfo")
+ .queryParam("foundry", "*").request().get();
+ assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
+ }
@Test
public void testGetMatchInfoWithAuthentication () throws KustvaktException {
diff --git a/src/test/resources/kustvakt-test.conf b/src/test/resources/kustvakt-test.conf
index e4abfec..99e13e5 100644
--- a/src/test/resources/kustvakt-test.conf
+++ b/src/test/resources/kustvakt-test.conf
@@ -20,8 +20,8 @@
# Kustvakt versions
#
# multiple versions comma separated
-current.api.version = v1.0
-supported.api.versions = v0.1, v1.0
+current.api.version = v1.1
+supported.api.versions = v1.0, v1.1
# Server
#