Commit 70067418 authored by Matija Obreza's avatar Matija Obreza

Renamed {UUID} path variable to {uuid}

parent 473f89b2
......@@ -121,9 +121,9 @@ public class AccessionController {
* @param uuid the uuid
* @return the subset
*/
@GetMapping(value = "/{UUID:\\w{8}\\-\\w{4}.+}", produces = { MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = "/{uuid:\\w{8}\\-\\w{4}.+}", produces = { MediaType.APPLICATION_JSON_VALUE })
@JsonView({ JsonViews.Protected.class })
public Accession getByUuid(@PathVariable("UUID") final UUID uuid) {
public Accession getByUuid(@PathVariable("uuid") final UUID uuid) {
return accessionService.getByUuid(uuid);
}
......@@ -215,9 +215,9 @@ public class AccessionController {
return accessionService.getAccessionDetails(accession);
}
@GetMapping(value = "/details/{UUID:\\w{8}\\-\\w{4}.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value = "/details/{uuid:\\w{8}\\-\\w{4}.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@JsonView(JsonViews.Root.class)
public AccessionService.AccessionDetails getAccessionDetailsByUUID(@PathVariable("UUID") final UUID uuid) {
public AccessionService.AccessionDetails getAccessionDetailsByUUID(@PathVariable("uuid") final UUID uuid) {
Accession accession = accessionService.getByUuid(uuid);
return accessionService.getAccessionDetails(accession);
}
......
......@@ -80,8 +80,8 @@ public class DescriptorController extends ApiBaseController {
* @param uuid the uuid
* @return the descriptor
*/
@RequestMapping(value = "/{UUID}", method = RequestMethod.GET)
public Descriptor getDescriptor(@PathVariable("UUID") final UUID uuid) {
@RequestMapping(value = "/{uuid}", method = RequestMethod.GET)
public Descriptor getDescriptor(@PathVariable("uuid") final UUID uuid) {
return descriptorService.getDescriptor(uuid);
}
......@@ -92,8 +92,8 @@ public class DescriptorController extends ApiBaseController {
* @param version the version
* @return the descriptor
*/
@DeleteMapping(value = "/{UUID},{version}")
public Descriptor deleteDescriptor(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
@DeleteMapping(value = "/{uuid},{version}")
public Descriptor deleteDescriptor(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version) {
try {
return descriptorService.removeDescriptor(descriptorService.getDescriptor(uuid, version));
} catch (DataIntegrityViolationException e) {
......@@ -322,10 +322,10 @@ public class DescriptorController extends ApiBaseController {
* @param uuid descriptor UUID
* @return the other descriptor info
*/
@RequestMapping(value = "/extra/{UUID}", method = RequestMethod.GET)
@RequestMapping(value = "/extra/{uuid}", method = RequestMethod.GET)
@SuppressWarnings("unused")
@JsonView(JsonViews.Minimal.class)
public Object getOtherDescriptorInfo(@PathVariable("UUID") final UUID uuid) {
public Object getOtherDescriptorInfo(@PathVariable("uuid") final UUID uuid) {
final Descriptor descriptor = descriptorService.getDescriptor(uuid);
return new Object() {
......
......@@ -85,8 +85,8 @@ public class DescriptorListController {
* @param uuid the uuid
* @return the descriptor list
*/
@GetMapping(value = "/{UUID}")
public DescriptorList getDescriptorList(@PathVariable("UUID") final UUID uuid) {
@GetMapping(value = "/{uuid}")
public DescriptorList getDescriptorList(@PathVariable("uuid") final UUID uuid) {
final DescriptorList descriptorList = descriptorListService.getDescriptorList(uuid);
return descriptorList;
}
......@@ -98,8 +98,8 @@ public class DescriptorListController {
* @param version the version
* @return the descriptor list
*/
@DeleteMapping(value = "/{UUID},{version}")
public DescriptorList deleteDescriptorList(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
@DeleteMapping(value = "/{uuid},{version}")
public DescriptorList deleteDescriptorList(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version) {
return descriptorListService.deleteDescriptorList(descriptorListService.getDescriptorList(uuid, version));
}
......@@ -111,8 +111,8 @@ public class DescriptorListController {
* @throws IOException Signals that an I/O exception has occurred.
*/
@Transactional(readOnly = true)
@GetMapping(value = "/{UUID}/html", produces = { "text/html" })
public void generateDocument(@PathVariable("UUID") final UUID uuid, final HttpServletResponse response) throws IOException {
@GetMapping(value = "/{uuid}/html", produces = { "text/html" })
public void generateDocument(@PathVariable("uuid") final UUID uuid, final HttpServletResponse response) throws IOException {
final DescriptorList descriptorList = descriptorListService.getDescriptorList(uuid);
final String descriptorListHtml = exporter.htmlDescriptorList(descriptorList);
......@@ -204,8 +204,8 @@ public class DescriptorListController {
* @param descriptorUuids the descriptor uuids
* @return the descriptor list
*/
@PostMapping(value = "/add-descriptors/{UUID},{version}")
public DescriptorList addDescriptor(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final List<UUID> descriptorUuids) {
@PostMapping(value = "/add-descriptors/{uuid},{version}")
public DescriptorList addDescriptor(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version, @RequestBody final List<UUID> descriptorUuids) {
final DescriptorList descriptorList = descriptorListService.getDescriptorList(uuid, version);
final List<Descriptor> descriptors = descriptorUuids.stream().map(descriptorUuid -> descriptorService.getDescriptor(descriptorUuid)).collect(Collectors.toList());
return descriptorListService.addDescriptors(descriptorList, descriptors.toArray(new Descriptor[] {}));
......@@ -219,8 +219,8 @@ public class DescriptorListController {
* @param descriptorUuids the descriptor uuids
* @return the descriptor list
*/
@PostMapping(value = "/remove-descriptors/{UUID},{version}")
public DescriptorList removeDescriptor(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> descriptorUuids) {
@PostMapping(value = "/remove-descriptors/{uuid},{version}")
public DescriptorList removeDescriptor(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> descriptorUuids) {
final DescriptorList descriptorList = descriptorListService.getDescriptorList(uuid, version);
final Set<Descriptor> descriptors = descriptorUuids.stream().map(descriptorUuid -> descriptorService.getDescriptor(descriptorUuid)).collect(Collectors.toSet());
return descriptorListService.removeDescriptors(descriptorList, descriptors.toArray(new Descriptor[] {}));
......@@ -234,8 +234,8 @@ public class DescriptorListController {
* @param descriptorUuids the descriptor uuids
* @return the descriptor list
*/
@PostMapping(value = "/set-descriptors/{UUID},{version}")
public DescriptorList setDescriptor(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final List<UUID> descriptorUuids) {
@PostMapping(value = "/set-descriptors/{uuid},{version}")
public DescriptorList setDescriptor(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version, @RequestBody final List<UUID> descriptorUuids) {
final DescriptorList descriptorList = descriptorListService.getDescriptorList(uuid, version);
final List<Descriptor> descriptors = descriptorUuids.stream().map(descriptorUuid -> descriptorService.getDescriptor(descriptorUuid)).collect(Collectors.toList());
return descriptorListService.setDescriptors(descriptorList, descriptors.toArray(new Descriptor[] {}));
......
......@@ -68,8 +68,8 @@ public class PartnerController {
* @param uuid the uuid
* @return the partner
*/
@GetMapping(value = "/{UUID}")
public Partner getPartner(@PathVariable("UUID") final UUID uuid) {
@GetMapping(value = "/{uuid}")
public Partner getPartner(@PathVariable("uuid") final UUID uuid) {
return partnerService.loadPartner(uuid);
}
......@@ -80,8 +80,8 @@ public class PartnerController {
* @param version the version
* @return the partner
*/
@DeleteMapping(value = "/{UUID},{version}")
public Partner deletePartner(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
@DeleteMapping(value = "/{uuid},{version}")
public Partner deletePartner(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version) {
return partnerService.removePartner(partnerService.loadPartner(uuid, version));
}
......
......@@ -102,8 +102,8 @@ public class SubsetController {
* @param uuid the uuid
* @return the subset
*/
@GetMapping(value = "/{UUID}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset get(@PathVariable("UUID") final UUID uuid) {
@GetMapping(value = "/{uuid}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset get(@PathVariable("uuid") final UUID uuid) {
return subsetService.get(uuid);
}
......@@ -114,8 +114,8 @@ public class SubsetController {
* @param version the version
* @return the subset
*/
@DeleteMapping(value = "/{UUID},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset remove(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
@DeleteMapping(value = "/{uuid},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset remove(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version) {
return subsetService.delete(subsetService.get(uuid, version));
}
......@@ -169,8 +169,8 @@ public class SubsetController {
* @param accessionsUuids the accessions UUIDs to be removed
* @return the subset
*/
@PostMapping(value = "/remove-accessions/{UUID},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset removeAccessions(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> accessionsUuids) {
@PostMapping(value = "/remove-accessions/{uuid},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset removeAccessions(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> accessionsUuids) {
final Subset subset = subsetService.get(uuid, version);
return subsetService.removeAccessions(subset, accessionsUuids);
}
......@@ -183,8 +183,8 @@ public class SubsetController {
* @param accessionIds the accessions UUIDs to be added
* @return the subset
*/
@PostMapping(value = "/add-accessions/{UUID},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset addAccessions(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> accessionIds) {
@PostMapping(value = "/add-accessions/{uuid},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset addAccessions(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Set<UUID> accessionIds) {
final Subset subset = subsetService.get(uuid, version);
return subsetService.addAccessions(subset, accessionIds);
}
......
......@@ -48,7 +48,7 @@ import org.springframework.web.bind.annotation.*;
public class SubsetCreatorController {
/** The Constant API_BASE. */
public static final String CONTROLLER_URL = SubsetController.API_BASE + "/{UUID}/subsetcreator";
public static final String CONTROLLER_URL = SubsetController.API_BASE + "/{uuid}/subsetcreator";
/** The subset service. */
@Autowired
......@@ -62,7 +62,7 @@ public class SubsetCreatorController {
* @return the page
*/
@GetMapping(value = "/list")
public Page<SubsetCreator> listSubsetCreators(@PathVariable("UUID") final UUID uuid, final Pagination page) {
public Page<SubsetCreator> listSubsetCreators(@PathVariable("uuid") final UUID uuid, final Pagination page) {
return subsetService.listSubsetCreators(uuid, page.toPageRequest(100, Sort.Direction.ASC, "id"));
}
......@@ -87,7 +87,7 @@ public class SubsetCreatorController {
* @throws NotFoundElement the not found element
*/
@PostMapping(value = "/create")
public SubsetCreator createSubsetCreator(@PathVariable("UUID") final UUID uuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
public SubsetCreator createSubsetCreator(@PathVariable("uuid") final UUID uuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
final Subset subset = subsetService.get(uuid);
return subsetService.createSubsetCreator(subset, subsetCreator);
}
......@@ -102,7 +102,7 @@ public class SubsetCreatorController {
*/
// uses request body
@RequestMapping(value = "/delete", method = { RequestMethod.POST, RequestMethod.DELETE })
public SubsetCreator deleteSubsetCreator(@PathVariable("UUID") final UUID subsetUuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
public SubsetCreator deleteSubsetCreator(@PathVariable("uuid") final UUID subsetUuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
final Subset subset = subsetService.get(subsetUuid);
return subsetService.removeSubsetCreator(subset, subsetCreator);
}
......@@ -116,7 +116,7 @@ public class SubsetCreatorController {
* @throws NotFoundElement the not found element
*/
@PostMapping(value = "/update")
public SubsetCreator updateSubsetCreator(@PathVariable("UUID") final UUID subsetUuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
public SubsetCreator updateSubsetCreator(@PathVariable("uuid") final UUID subsetUuid, @RequestBody final SubsetCreator subsetCreator) throws NotFoundElement {
final Subset subset = subsetService.get(subsetUuid);
return subsetService.updateSubsetCreator(subset, subsetCreator);
}
......
......@@ -106,8 +106,8 @@ public class VocabularyController {
* @param uuid the uuid
* @return the controlled vocabulary
*/
@GetMapping(value = "/{UUID}")
public ControlledVocabulary get(@PathVariable("UUID") final UUID uuid) {
@GetMapping(value = "/{uuid}")
public ControlledVocabulary get(@PathVariable("uuid") final UUID uuid) {
return vocabularyService.getVocabulary(uuid);
}
......@@ -118,8 +118,8 @@ public class VocabularyController {
* @param code the code
* @return the term
*/
@GetMapping(value = "/{UUID}/{code}")
public VocabularyTerm getTerm(@PathVariable("UUID") final UUID uuid, @PathVariable("code") final String code) throws IOException, ServletException {
@GetMapping(value = "/{uuid}/{code}")
public VocabularyTerm getTerm(@PathVariable("uuid") final UUID uuid, @PathVariable("code") final String code) throws IOException, ServletException {
switch (uuid.toString()) {
case FAO_WIEWS_UUID:
......@@ -142,9 +142,9 @@ public class VocabularyController {
* @param like the like
* @return the list
*/
@PostMapping(value = "/{UUID}/autocomplete")
@PostMapping(value = "/{uuid}/autocomplete")
@JsonView({ JsonViews.Public.class })
public List<VocabularyTerm> autocompleteTerm(@PathVariable("UUID") final UUID uuid, @RequestParam("q") final String like) {
public List<VocabularyTerm> autocompleteTerm(@PathVariable("uuid") final UUID uuid, @RequestParam("q") final String like) {
return vocabularyService.autocompleteTerms(uuid, like);
}
......@@ -155,9 +155,9 @@ public class VocabularyController {
* @param page the page
* @return the page
*/
@PostMapping(value = "/{UUID}/terms")
@PostMapping(value = "/{uuid}/terms")
@JsonView({ JsonViews.Public.class })
public Page<VocabularyTerm> listTerms(@PathVariable("UUID") final UUID uuid, final Pagination page) {
public Page<VocabularyTerm> listTerms(@PathVariable("uuid") final UUID uuid, final Pagination page) {
// LOG.warn("Loading vocab");
final ControlledVocabulary vocabulary = vocabularyService.getVocabulary(uuid);
// LOG.warn("Loading terms");
......@@ -183,8 +183,8 @@ public class VocabularyController {
* @param version the version
* @return the controlled vocabulary
*/
@DeleteMapping(value = "/{UUID},{version}")
public ControlledVocabulary delete(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
@DeleteMapping(value = "/{uuid},{version}")
public ControlledVocabulary delete(@PathVariable("uuid") final UUID uuid, @PathVariable("version") final int version) {
return vocabularyService.deleteVocabulary(vocabularyService.getVocabulary(uuid, version));
}
......
......@@ -256,8 +256,8 @@ public class AccessionController extends BaseController {
return "/accession/resolve";
}
@GetMapping(value = "/{UUID:\\w{8}\\-\\w{4}.+}")
public String viewAccessionByUUID(final ModelMap model, @PathVariable("UUID") final UUID uuid) {
@GetMapping(value = "/{uuid:\\w{8}\\-\\w{4}.+}")
public String viewAccessionByUUID(final ModelMap model, @PathVariable("uuid") final UUID uuid) {
final Accession accession = accessionService.getByUuid(uuid);
if (accession == null) {
......
......@@ -79,8 +79,8 @@ public class SubsetController extends BaseController {
return "/subset/index";
}
@GetMapping(value = "/{UUID}")
public String subset(final HttpServletResponse response, final ModelMap model, @PathVariable("UUID") final UUID uuid,
@GetMapping(value = "/{uuid}")
public String subset(final HttpServletResponse response, final ModelMap model, @PathVariable("uuid") final UUID uuid,
@RequestParam(value = "page", required = false, defaultValue = "1") int page) {
Subset subset;
......
......@@ -55,7 +55,7 @@ public class DatasetControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.get(DatasetController.CONTROLLER_URL.concat("/{UUID}"), dataset.getUuid()))
.perform(RestDocumentationRequestBuilders.get(DatasetController.CONTROLLER_URL.concat("/{uuid}"), dataset.getUuid()))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -136,7 +136,7 @@ public class DatasetControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.get(DatasetController.CONTROLLER_URL.concat("/{UUID}"), UUID.randomUUID())
.perform(RestDocumentationRequestBuilders.get(DatasetController.CONTROLLER_URL.concat("/{uuid}"), UUID.randomUUID())
.accept(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isNotFound());
......@@ -289,7 +289,7 @@ public class DatasetControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/upsertaccessions/{UUID},{version}", dataset.getUuid(), dataset.getVersion())
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/upsertaccessions/{uuid},{version}", dataset.getUuid(), dataset.getVersion())
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
......@@ -314,7 +314,7 @@ public class DatasetControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/add-descriptors/{UUID},{version}", dataset.getUuid(), dataset.getVersion())
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/add-descriptors/{uuid},{version}", dataset.getUuid(), dataset.getVersion())
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
......@@ -339,7 +339,7 @@ public class DatasetControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/remove-descriptors/{UUID},{version}", dataset.getUuid(), dataset.getVersion())
.perform(RestDocumentationRequestBuilders.post(DatasetController.CONTROLLER_URL + "/remove-descriptors/{uuid},{version}", dataset.getUuid(), dataset.getVersion())
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
......
......@@ -192,7 +192,7 @@ public class DescriptorControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.get(DescriptorController.CONTROLLER_URL.concat("/{UUID}"), descriptor.getUuid()))
.perform(RestDocumentationRequestBuilders.get(DescriptorController.CONTROLLER_URL.concat("/{uuid}"), descriptor.getUuid()))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......
......@@ -262,7 +262,7 @@ public class DescriptorListControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc
.perform(RestDocumentationRequestBuilders.get(DescriptorListController.CONTROLLER_URL + "/{UUID}", descriptorList.getUuid())
.perform(RestDocumentationRequestBuilders.get(DescriptorListController.CONTROLLER_URL + "/{uuid}", descriptorList.getUuid())
.content(s)
.contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
......@@ -283,7 +283,7 @@ public class DescriptorListControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc.perform(RestDocumentationRequestBuilders
.delete(DescriptorListController.CONTROLLER_URL + "/{UUID},{version}", descriptorList.getUuid(), descriptorList.getVersion())
.delete(DescriptorListController.CONTROLLER_URL + "/{uuid},{version}", descriptorList.getUuid(), descriptorList.getVersion())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isBadRequest());
......@@ -298,7 +298,7 @@ public class DescriptorListControllerTest extends AbstractApiTest {
/*@formatter:off*/
mockMvc.perform(RestDocumentationRequestBuilders
.delete(DescriptorListController.CONTROLLER_URL + "/{UUID},{version}", descriptorList.getUuid(), descriptorList.getVersion())
.delete(DescriptorListController.CONTROLLER_URL + "/{uuid},{version}", descriptorList.getUuid(), descriptorList.getVersion())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk());
......
......@@ -254,7 +254,7 @@ public class PartnerControllerTest extends AbstractApiTest {
/*@formatter:off*/
this.mockMvc
.perform(RestDocumentationRequestBuilders.get(PartnerController.CONTROLLER_URL.concat("/{UUID}"), partner.getUuid())
.perform(RestDocumentationRequestBuilders.get(PartnerController.CONTROLLER_URL.concat("/{uuid}"), partner.getUuid())
.content(s).contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
......
......@@ -207,7 +207,7 @@ public class SubsetRestControllerTest extends AbstractApiTest {
final Subset subset = subsetService.create(institute, setUpSubset());
/*@formatter:off*/
mockMvc.perform(get(SubsetController.API_BASE.concat("/{UUID}"), subset.getUuid())
mockMvc.perform(get(SubsetController.API_BASE.concat("/{uuid}"), subset.getUuid())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
......@@ -221,7 +221,7 @@ public class SubsetRestControllerTest extends AbstractApiTest {
final Subset subset = subsetService.create(institute, setUpSubset());
/*@formatter:off*/
mockMvc.perform(delete(SubsetController.API_BASE.concat("/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(delete(SubsetController.API_BASE.concat("/{uuid},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
......@@ -264,7 +264,7 @@ public class SubsetRestControllerTest extends AbstractApiTest {
final Set<UUID> accessionsUuid = subset.getAccessionRefs().stream().map(AccessionRef::getAccession).map(Accession::getUuid).collect(Collectors.toSet());
/*@formatter:off*/
mockMvc.perform(post(SubsetController.API_BASE.concat("/remove-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(post(SubsetController.API_BASE.concat("/remove-accessions/{uuid},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(accessionsUuid)))
// .andDo(MockMvcResultHandlers.print())
......@@ -285,7 +285,7 @@ public class SubsetRestControllerTest extends AbstractApiTest {
final Set<UUID> accessionsUuid = newAccessions.stream().map(AccessionRef::getAccession).map(Accession::getUuid).collect(Collectors.toSet());
/*@formatter:off*/
mockMvc.perform(post(SubsetController.API_BASE.concat("/add-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(post(SubsetController.API_BASE.concat("/add-accessions/{uuid},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(accessionsUuid)))
// .andDo(MockMvcResultHandlers.print())
......
......@@ -117,7 +117,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
@WithMockUser
public void getUserTest() throws Exception {
/*@formatter:off*/
mockMvc.perform(get(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}"), user.getUuid())
mockMvc.perform(get(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -131,7 +131,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
@WithMockUser(roles = "ADMINISTRATOR")
public void lockAccountTest() throws Exception {
/*@formatter:off*/
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}/lock"), user.getUuid())
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}/lock"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -148,7 +148,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
lockAccountTest();
/*@formatter:off*/
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}/unlock"), user.getUuid())
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}/unlock"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -163,7 +163,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
@WithMockUser(roles = "ADMINISTRATOR")
public void disableAccountTest() throws Exception {
/*@formatter:off*/
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}/disable"), user.getUuid())
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}/disable"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -181,7 +181,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
disableAccountTest();
/*@formatter:off*/
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}/enable"), user.getUuid())
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}/enable"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......@@ -197,7 +197,7 @@ public class UserManagementControllerTest extends AbstractApiTest {
@WithMockUser(roles = "ADMINISTRATOR")
public void archiveAccountTest() throws Exception {
/*@formatter:off*/
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{UUID}/archive"), user.getUuid())
mockMvc.perform(post(UserManagementController.CONTROLLER_URL.concat("/u/{uuid}/archive"), user.getUuid())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment