mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
fix failed tests
This commit is contained in:
@@ -206,7 +206,7 @@ public class SubmissionDefinitionsControllerIT extends AbstractControllerIntegra
|
|||||||
// We expect the content type to be "application/hal+json;charset=UTF-8"
|
// We expect the content type to be "application/hal+json;charset=UTF-8"
|
||||||
.andExpect(content().contentType(contentType))
|
.andExpect(content().contentType(contentType))
|
||||||
// Match only that a section exists with a submission configuration behind
|
// Match only that a section exists with a submission configuration behind
|
||||||
.andExpect(jsonPath("$._embedded.submissionsections", hasSize(6)))
|
.andExpect(jsonPath("$._embedded.submissionsections", hasSize(7)))
|
||||||
.andExpect(jsonPath("$._embedded.submissionsections",
|
.andExpect(jsonPath("$._embedded.submissionsections",
|
||||||
Matchers.hasItem(
|
Matchers.hasItem(
|
||||||
allOf(
|
allOf(
|
||||||
@@ -258,10 +258,10 @@ public class SubmissionDefinitionsControllerIT extends AbstractControllerIntegra
|
|||||||
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=3"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$.page.size", is(1)))
|
.andExpect(jsonPath("$.page.size", is(1)))
|
||||||
.andExpect(jsonPath("$.page.totalElements", is(3)))
|
.andExpect(jsonPath("$.page.totalElements", is(4)))
|
||||||
.andExpect(jsonPath("$.page.totalPages", is(3)))
|
.andExpect(jsonPath("$.page.totalPages", is(4)))
|
||||||
.andExpect(jsonPath("$.page.number", is(0)));
|
.andExpect(jsonPath("$.page.number", is(0)));
|
||||||
|
|
||||||
getClient(tokenAdmin).perform(get("/api/config/submissiondefinitions")
|
getClient(tokenAdmin).perform(get("/api/config/submissiondefinitions")
|
||||||
@@ -269,7 +269,7 @@ public class SubmissionDefinitionsControllerIT extends AbstractControllerIntegra
|
|||||||
.param("page", "1"))
|
.param("page", "1"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(content().contentType(contentType))
|
.andExpect(content().contentType(contentType))
|
||||||
.andExpect(jsonPath("$._embedded.submissiondefinitions[0].id", is("languagetestprocess")))
|
.andExpect(jsonPath("$._embedded.submissiondefinitions[0].id", is("accessConditionNotDiscoverable")))
|
||||||
.andExpect(jsonPath("$._links.first.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.first.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=0"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=0"), Matchers.containsString("size=1"))))
|
||||||
@@ -284,10 +284,10 @@ public class SubmissionDefinitionsControllerIT extends AbstractControllerIntegra
|
|||||||
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=3"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$.page.size", is(1)))
|
.andExpect(jsonPath("$.page.size", is(1)))
|
||||||
.andExpect(jsonPath("$.page.totalElements", is(3)))
|
.andExpect(jsonPath("$.page.totalElements", is(4)))
|
||||||
.andExpect(jsonPath("$.page.totalPages", is(3)))
|
.andExpect(jsonPath("$.page.totalPages", is(4)))
|
||||||
.andExpect(jsonPath("$.page.number", is(1)));
|
.andExpect(jsonPath("$.page.number", is(1)));
|
||||||
|
|
||||||
getClient(tokenAdmin).perform(get("/api/config/submissiondefinitions")
|
getClient(tokenAdmin).perform(get("/api/config/submissiondefinitions")
|
||||||
@@ -295,24 +295,47 @@ public class SubmissionDefinitionsControllerIT extends AbstractControllerIntegra
|
|||||||
.param("page", "2"))
|
.param("page", "2"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(content().contentType(contentType))
|
.andExpect(content().contentType(contentType))
|
||||||
|
.andExpect(jsonPath("$._embedded.submissiondefinitions[0].id", is("languagetestprocess")))
|
||||||
|
.andExpect(jsonPath("$._links.first.href", Matchers.allOf(
|
||||||
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
|
Matchers.containsString("page=0"), Matchers.containsString("size=1"))))
|
||||||
|
.andExpect(jsonPath("$._links.prev.href", Matchers.allOf(
|
||||||
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
|
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
||||||
|
.andExpect(jsonPath("$._links.self.href", Matchers.allOf(
|
||||||
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
|
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
||||||
|
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
||||||
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
|
Matchers.containsString("page=3"), Matchers.containsString("size=1"))))
|
||||||
|
.andExpect(jsonPath("$.page.size", is(1)))
|
||||||
|
.andExpect(jsonPath("$.page.totalElements", is(4)))
|
||||||
|
.andExpect(jsonPath("$.page.totalPages", is(4)))
|
||||||
|
.andExpect(jsonPath("$.page.number", is(2)));
|
||||||
|
|
||||||
|
getClient(tokenAdmin).perform(get("/api/config/submissiondefinitions")
|
||||||
|
.param("size", "1")
|
||||||
|
.param("page", "3"))
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
.andExpect(content().contentType(contentType))
|
||||||
.andExpect(jsonPath("$._embedded.submissiondefinitions[0].id", is("extractiontestprocess")))
|
.andExpect(jsonPath("$._embedded.submissiondefinitions[0].id", is("extractiontestprocess")))
|
||||||
.andExpect(jsonPath("$._links.first.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.first.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=0"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=0"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$._links.prev.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.prev.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=1"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$._links.next").doesNotExist())
|
.andExpect(jsonPath("$._links.next").doesNotExist())
|
||||||
.andExpect(jsonPath("$._links.self.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.self.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=3"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
.andExpect(jsonPath("$._links.last.href", Matchers.allOf(
|
||||||
Matchers.containsString("/api/config/submissiondefinitions?"),
|
Matchers.containsString("/api/config/submissiondefinitions?"),
|
||||||
Matchers.containsString("page=2"), Matchers.containsString("size=1"))))
|
Matchers.containsString("page=3"), Matchers.containsString("size=1"))))
|
||||||
.andExpect(jsonPath("$.page.size", is(1)))
|
.andExpect(jsonPath("$.page.size", is(1)))
|
||||||
.andExpect(jsonPath("$.page.totalElements", is(3)))
|
.andExpect(jsonPath("$.page.totalElements", is(4)))
|
||||||
.andExpect(jsonPath("$.page.totalPages", is(3)))
|
.andExpect(jsonPath("$.page.totalPages", is(4)))
|
||||||
.andExpect(jsonPath("$.page.number", is(2)));
|
.andExpect(jsonPath("$.page.number", is(3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user