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