mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
105866: test fixes
This commit is contained in:
@@ -16,6 +16,7 @@ import com.nimbusds.jose.crypto.MACVerifier;
|
|||||||
import com.nimbusds.jwt.JWTClaimsSet;
|
import com.nimbusds.jwt.JWTClaimsSet;
|
||||||
import com.nimbusds.jwt.SignedJWT;
|
import com.nimbusds.jwt.SignedJWT;
|
||||||
import com.nimbusds.jwt.util.DateUtils;
|
import com.nimbusds.jwt.util.DateUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@@ -5822,10 +5822,6 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
|
|||||||
.andExpect(jsonPath("$._embedded.searchResult._embedded.objects", Matchers.contains(
|
.andExpect(jsonPath("$._embedded.searchResult._embedded.objects", Matchers.contains(
|
||||||
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
||||||
)))
|
)))
|
||||||
.andExpect(jsonPath("$._embedded.searchResult._embedded.objects",Matchers.contains(
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Mathematical Theory"))))
|
|
||||||
)))
|
|
||||||
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(1)));
|
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(1)));
|
||||||
|
|
||||||
getClient(adminToken).perform(get("/api/discover/search/objects")
|
getClient(adminToken).perform(get("/api/discover/search/objects")
|
||||||
@@ -5839,12 +5835,6 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
|
|||||||
SearchResultMatcher.match("workflow", "pooltask", "pooltasks"),
|
SearchResultMatcher.match("workflow", "pooltask", "pooltasks"),
|
||||||
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
||||||
)))
|
)))
|
||||||
.andExpect(jsonPath("$._embedded.searchResult._embedded.objects",Matchers.containsInAnyOrder(
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Metaphysics")))),
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Test Metaphysics"))))
|
|
||||||
)))
|
|
||||||
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(2)));
|
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5909,14 +5899,6 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
|
|||||||
SearchResultMatcher.match("workflow", "pooltask", "pooltasks"),
|
SearchResultMatcher.match("workflow", "pooltask", "pooltasks"),
|
||||||
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
SearchResultMatcher.match("workflow", "pooltask", "pooltasks")
|
||||||
)))
|
)))
|
||||||
.andExpect(jsonPath("$._embedded.searchResult._embedded.objects",Matchers.containsInAnyOrder(
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Mathematical Theory")))),
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Metaphysics")))),
|
|
||||||
allOf(hasJsonPath("$._embedded.indexableObject._embedded.workflowitem._embedded.item",
|
|
||||||
is(SearchResultMatcher.matchEmbeddedObjectOnItemName("item", "Test Metaphysics"))))
|
|
||||||
)))
|
|
||||||
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(3)));
|
.andExpect(jsonPath("$._embedded.searchResult.page.totalElements", is(3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -191,6 +191,7 @@ public class LoginAsEPersonIT extends AbstractControllerIntegrationTest {
|
|||||||
// create a workspaceitem explicitly in the col1
|
// create a workspaceitem explicitly in the col1
|
||||||
MvcResult mvcResult = getClient(authToken).perform(post("/api/submission/workspaceitems")
|
MvcResult mvcResult = getClient(authToken).perform(post("/api/submission/workspaceitems")
|
||||||
.param("owningCollection", col1.getID().toString())
|
.param("owningCollection", col1.getID().toString())
|
||||||
|
.param("embed", "collection")
|
||||||
.header("X-On-Behalf-Of", eperson.getID())
|
.header("X-On-Behalf-Of", eperson.getID())
|
||||||
.contentType(org.springframework
|
.contentType(org.springframework
|
||||||
.http.MediaType.APPLICATION_JSON))
|
.http.MediaType.APPLICATION_JSON))
|
||||||
@@ -204,7 +205,8 @@ public class LoginAsEPersonIT extends AbstractControllerIntegrationTest {
|
|||||||
Map<String,Object> map = mapper.readValue(content, Map.class);
|
Map<String,Object> map = mapper.readValue(content, Map.class);
|
||||||
String workspaceItemId = String.valueOf(map.get("id"));
|
String workspaceItemId = String.valueOf(map.get("id"));
|
||||||
|
|
||||||
getClient(authToken).perform(get("/api/submission/workspaceitems/" + workspaceItemId))
|
getClient(authToken).perform(get("/api/submission/workspaceitems/" + workspaceItemId)
|
||||||
|
.param("embed", "submitter"))
|
||||||
.andExpect(jsonPath("$._embedded.submitter", EPersonMatcher.matchProperties(eperson)));
|
.andExpect(jsonPath("$._embedded.submitter", EPersonMatcher.matchProperties(eperson)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -878,6 +878,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create a workspaceitem explicitly in the col1
|
// create a workspaceitem explicitly in the col1
|
||||||
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
||||||
.param("owningCollection", col1.getID().toString())
|
.param("owningCollection", col1.getID().toString())
|
||||||
|
.param("embed", "collection")
|
||||||
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
||||||
.andExpect(status().isCreated())
|
.andExpect(status().isCreated())
|
||||||
.andExpect(jsonPath("$._embedded.collection.id", is(col1.getID().toString())))
|
.andExpect(jsonPath("$._embedded.collection.id", is(col1.getID().toString())))
|
||||||
@@ -886,6 +887,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create a workspaceitem explicitly in the col2
|
// create a workspaceitem explicitly in the col2
|
||||||
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
||||||
.param("owningCollection", col2.getID().toString())
|
.param("owningCollection", col2.getID().toString())
|
||||||
|
.param("embed", "collection")
|
||||||
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
||||||
.andExpect(status().isCreated())
|
.andExpect(status().isCreated())
|
||||||
.andExpect(jsonPath("$._embedded.collection.id", is(col2.getID().toString())))
|
.andExpect(jsonPath("$._embedded.collection.id", is(col2.getID().toString())))
|
||||||
@@ -894,10 +896,10 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create a workspaceitem without an explicit collection, this will go in the first valid collection for the
|
// create a workspaceitem without an explicit collection, this will go in the first valid collection for the
|
||||||
// user: the col1
|
// user: the col1
|
||||||
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
getClient(authToken).perform(post("/api/submission/workspaceitems")
|
||||||
|
.param("embed", "collection")
|
||||||
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
.contentType(org.springframework.http.MediaType.APPLICATION_JSON))
|
||||||
.andExpect(status().isCreated())
|
.andExpect(status().isCreated())
|
||||||
.andExpect(jsonPath("$._embedded.collection.id", is(col1.getID().toString())))
|
.andExpect(jsonPath("$._embedded.collection.id", is(col1.getID().toString())))
|
||||||
.andExpect(jsonPath("$", WorkspaceItemMatcher.matchFullEmbeds()))
|
|
||||||
.andDo(result -> idRef3.set(read(result.getResponse().getContentAsString(), "$.id")));
|
.andDo(result -> idRef3.set(read(result.getResponse().getContentAsString(), "$.id")));
|
||||||
|
|
||||||
|
|
||||||
@@ -945,7 +947,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile))
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -974,6 +977,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile)
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1037,7 +1041,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile))
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
||||||
@@ -1071,6 +1076,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile)
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
||||||
@@ -1134,7 +1140,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile))
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections." +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections." +
|
||||||
@@ -1165,6 +1172,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile)
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections." +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections." +
|
||||||
@@ -1231,7 +1239,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile))
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
||||||
@@ -1271,6 +1280,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile)
|
.file(bibtexFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
.andExpect(jsonPath("$._embedded.workspaceitems[0]" +
|
||||||
@@ -1336,7 +1346,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
AtomicReference<List<Integer>> idRef = new AtomicReference<>();
|
AtomicReference<List<Integer>> idRef = new AtomicReference<>();
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(csvFile))
|
.file(csvFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1376,6 +1387,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(csvFile)
|
.file(csvFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone"
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone"
|
||||||
@@ -1453,7 +1465,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(csvFile))
|
.file(csvFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1531,7 +1544,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create workspaceitems in the default collection (col1)
|
// create workspaceitems in the default collection (col1)
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(tsvFile))
|
.file(tsvFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1607,7 +1621,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create workspaceitems in the default collection (col1)
|
// create workspaceitems in the default collection (col1)
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(tsvFile))
|
.file(tsvFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1684,7 +1699,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create workspaceitems in the default collection (col1)
|
// create workspaceitems in the default collection (col1)
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(endnoteFile))
|
.file(endnoteFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1763,7 +1779,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create workspaceitems in the default collection (col1)
|
// create workspaceitems in the default collection (col1)
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(csvFile))
|
.file(csvFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1844,7 +1861,9 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
// create a workspaceitem from a single bibliographic entry file explicitly in the default collection (col1)
|
||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile).file(pubmedFile))
|
.file(bibtexFile)
|
||||||
|
.file(pubmedFile)
|
||||||
|
.param("embed", "collection"))
|
||||||
// create should return 200, 201 (created) is better for single resource
|
// create should return 200, 201 (created) is better for single resource
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -1879,6 +1898,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
try {
|
try {
|
||||||
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
getClient(authToken).perform(multipart("/api/submission/workspaceitems")
|
||||||
.file(bibtexFile).file(pubmedFile)
|
.file(bibtexFile).file(pubmedFile)
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col2.getID().toString()))
|
.param("owningCollection", col2.getID().toString()))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
.andExpect(jsonPath("$._embedded.workspaceitems[0].sections.traditionalpageone['dc.title'][0].value",
|
||||||
@@ -4323,6 +4343,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
String token = getAuthToken(admin.getEmail(), password);
|
String token = getAuthToken(admin.getEmail(), password);
|
||||||
MvcResult mvcResult = getClient(token).perform(post("/api/submission/workspaceitems?owningCollection="
|
MvcResult mvcResult = getClient(token).perform(post("/api/submission/workspaceitems?owningCollection="
|
||||||
+ col1.getID().toString())
|
+ col1.getID().toString())
|
||||||
|
.param("embed", "item")
|
||||||
.contentType(parseMediaType(TEXT_URI_LIST_VALUE))
|
.contentType(parseMediaType(TEXT_URI_LIST_VALUE))
|
||||||
.content("https://localhost:8080/server/api/integration/" +
|
.content("https://localhost:8080/server/api/integration/" +
|
||||||
"externalsources/mock/entryValues/one"))
|
"externalsources/mock/entryValues/one"))
|
||||||
@@ -4333,7 +4354,8 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
workspaceItemId = (Integer) map.get("id");
|
workspaceItemId = (Integer) map.get("id");
|
||||||
String itemUuidString = String.valueOf(((Map) ((Map) map.get("_embedded")).get("item")).get("uuid"));
|
String itemUuidString = String.valueOf(((Map) ((Map) map.get("_embedded")).get("item")).get("uuid"));
|
||||||
|
|
||||||
getClient(token).perform(get("/api/submission/workspaceitems/" + workspaceItemId))
|
getClient(token).perform(get("/api/submission/workspaceitems/" + workspaceItemId)
|
||||||
|
.param("embed", "item"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", Matchers.allOf(
|
.andExpect(jsonPath("$", Matchers.allOf(
|
||||||
hasJsonPath("$.id", is(workspaceItemId)),
|
hasJsonPath("$.id", is(workspaceItemId)),
|
||||||
@@ -4528,6 +4550,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
|
|
||||||
String token = getAuthToken(eperson.getEmail(), password);
|
String token = getAuthToken(eperson.getEmail(), password);
|
||||||
getClient(token).perform(post("/api/submission/workspaceitems")
|
getClient(token).perform(post("/api/submission/workspaceitems")
|
||||||
|
.param("embed", "collection")
|
||||||
.param("owningCollection", col1.getID().toString())
|
.param("owningCollection", col1.getID().toString())
|
||||||
.contentType(parseMediaType(TEXT_URI_LIST_VALUE))
|
.contentType(parseMediaType(TEXT_URI_LIST_VALUE))
|
||||||
.content("https://localhost:8080/server/api/integration/externalsources/" +
|
.content("https://localhost:8080/server/api/integration/externalsources/" +
|
||||||
@@ -4537,7 +4560,9 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
.andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id")));
|
.andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id")));
|
||||||
workspaceItemId = idRef.get();
|
workspaceItemId = idRef.get();
|
||||||
|
|
||||||
getClient(token).perform(get("/api/submission/workspaceitems/" + workspaceItemId))
|
getClient(token).perform(get("/api/submission/workspaceitems/" + workspaceItemId)
|
||||||
|
.param("embed", "collection")
|
||||||
|
.param("embed", "item"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$", Matchers.allOf(
|
.andExpect(jsonPath("$", Matchers.allOf(
|
||||||
hasJsonPath("$.id", is(workspaceItemId)),
|
hasJsonPath("$.id", is(workspaceItemId)),
|
||||||
|
Reference in New Issue
Block a user