Skip to content

Commit

Permalink
Updated tests using the old match info web-services (#757)
Browse files Browse the repository at this point in the history
Change-Id: Ic02bd5137860b592e15617ac61bd70a65e4cd3cd
  • Loading branch information
margaretha committed Jun 5, 2024
1 parent 205dc5b commit d709be5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

- Added tests for the DNB scenario with custom max match
and context size. (#745)
- Clean up named-vc.
- Cleaned up named-vc.
- Updated tests using the old match info web-services (#757)

# version 0.73.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class MatchInfoControllerTest extends SpringJerseyTest {
public void testGetMatchInfoPublicCorpus () 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();
.queryParam("foundry", "*").request().get();
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
Expand All @@ -41,7 +41,7 @@ public void testGetMatchInfoPublicCorpus () throws KustvaktException {
public void testGetMatchInfoNotAllowed () throws KustvaktException {
Response response = target().path(API_VERSION).path("corpus")
.path("GOE").path("AGI").path("04846").path("p36875-36876")
.path("matchInfo").queryParam("foundry", "*").request().get();
.queryParam("foundry", "*").request().get();
assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
Expand All @@ -58,7 +58,7 @@ public void testGetMatchInfoNotAllowed () throws KustvaktException {
public void testGetMatchInfoWithAuthentication () throws KustvaktException {
Response response = target().path(API_VERSION).path("corpus")
.path("GOE").path("AGI").path("04846").path("p36875-36876")
.path("matchInfo").queryParam("foundry", "*").request()
.queryParam("foundry", "*").request()
.header(Attributes.AUTHORIZATION,
HttpAuthorizationHandler
.createBasicAuthorizationHeaderValue("kustvakt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void testParameterField () throws KustvaktException {
@Test
public void testMatchInfoGetWithoutSpans () throws KustvaktException {
Response response = target().path(API_VERSION)
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42")
.queryParam("foundry", "*").queryParam("spans", "false")
.request().get();
assertEquals(Status.OK.getStatusCode(), response.getStatus());
Expand All @@ -187,7 +187,7 @@ public void testMatchInfoGetWithoutSpans () throws KustvaktException {
@Test
public void testMatchInfoGetWithoutHighlights () throws KustvaktException {
Response response = target().path(API_VERSION)
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42")
.queryParam("foundry", "xy").queryParam("spans", "false")
.request().get();
assertEquals(Status.OK.getStatusCode(), response.getStatus());
Expand Down Expand Up @@ -223,7 +223,7 @@ public void testMatchInfoWithoutExtension () throws KustvaktException {
@Test
public void testMatchInfoGetWithHighlights () throws KustvaktException {
Response response = target().path(API_VERSION)
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42")
.queryParam("foundry", "xy").queryParam("spans", "false")
.queryParam("hls", "true").request().get();
assertEquals(Status.OK.getStatusCode(), response.getStatus());
Expand All @@ -249,7 +249,7 @@ public void testMatchInfoGetWithHighlights () throws KustvaktException {
@Test
public void testMatchInfoGet2 () throws KustvaktException {
Response response = target().path(API_VERSION)
.path("corpus/GOE/AGA/01784/p36-46/matchInfo")
.path("corpus/GOE/AGA/01784/p36-46")
.queryParam("foundry", "*").request().get();
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String ent = response.readEntity(String.class);
Expand Down

0 comments on commit d709be5

Please sign in to comment.