mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 02:24:18 +00:00
Merge pull request #8260 from toniprieto/cc-section-not-loading
Fix Creative Commons step not loading
This commit is contained in:
@@ -306,7 +306,9 @@ public class SubmissionService {
|
|||||||
result.setRights(creativeCommonsService.getLicenseName(item));
|
result.setRights(creativeCommonsService.getLicenseName(item));
|
||||||
|
|
||||||
Bitstream licenseRdfBitstream = creativeCommonsService.getLicenseRdfBitstream(item);
|
Bitstream licenseRdfBitstream = creativeCommonsService.getLicenseRdfBitstream(item);
|
||||||
|
if (licenseRdfBitstream != null) {
|
||||||
result.setFile(converter.toRest(licenseRdfBitstream, Projection.DEFAULT));
|
result.setFile(converter.toRest(licenseRdfBitstream, Projection.DEFAULT));
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.rest;
|
|||||||
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
||||||
import static org.hamcrest.Matchers.allOf;
|
import static org.hamcrest.Matchers.allOf;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.nullValue;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||||
@@ -118,7 +118,11 @@ public class CCLicenseAddPatchOperationIT extends AbstractControllerIntegrationT
|
|||||||
.content(patchBody)
|
.content(patchBody)
|
||||||
.contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
|
.contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$.sections", not(hasJsonPath("cclicense"))));
|
.andExpect(jsonPath("$.sections.cclicense", allOf(
|
||||||
|
hasJsonPath("$.uri", nullValue()),
|
||||||
|
hasJsonPath("$.rights",nullValue()),
|
||||||
|
hasJsonPath("$.file", nullValue())
|
||||||
|
)));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.rest;
|
|||||||
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
||||||
import static org.hamcrest.Matchers.allOf;
|
import static org.hamcrest.Matchers.allOf;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.nullValue;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
@@ -95,7 +95,11 @@ public class CCLicenseRemovePatchOperationIT extends AbstractControllerIntegrati
|
|||||||
.content(removePatch)
|
.content(removePatch)
|
||||||
.contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
|
.contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$.sections", not(hasJsonPath("cclicense"))));
|
.andExpect(jsonPath("$.sections.cclicense", allOf(
|
||||||
|
hasJsonPath("$.uri", nullValue()),
|
||||||
|
hasJsonPath("$.rights",nullValue()),
|
||||||
|
hasJsonPath("$.file", nullValue())
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user