TSK-1243: made rest url for workbasket distribution-targets consistent

This commit is contained in:
Mustapha Zorgati 2020-05-10 23:17:33 +02:00
parent dd2e5cd877
commit 75a340ccf3
5 changed files with 4 additions and 8 deletions

View File

@ -43,9 +43,6 @@ public final class Mapping {
URL_WORKBASKET_ID + "/workbasketAccessItems";
public static final String URL_WORKBASKET_ID_DISTRIBUTION =
URL_WORKBASKET_ID + "/distribution-targets";
// TODO @Deprecated
public static final String URL_WORKBASKET_DISTRIBUTION_ID =
URL_WORKBASKET + "/distribution-targets/{workbasketId}";
public static final String URL_WORKBASKETDEFIITIONS = PRE + "workbasket-definitions";
private Mapping() {}

View File

@ -311,8 +311,7 @@ public class WorkbasketController extends AbstractPagingController {
return response;
}
// TODO - schema inconsistent with PUT and GET
@DeleteMapping(path = Mapping.URL_WORKBASKET_DISTRIBUTION_ID)
@DeleteMapping(path = Mapping.URL_WORKBASKET_ID_DISTRIBUTION)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<CollectionModel<DistributionTargetResource>>
removeDistributionTargetForWorkbasketId(

View File

@ -400,7 +400,7 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
.perform(
RestDocumentationRequestBuilders.delete(
restHelper.toUrl(
Mapping.URL_WORKBASKET_DISTRIBUTION_ID,
Mapping.URL_WORKBASKET_ID_DISTRIBUTION,
"WBI:100000000000000000000000000000000007"))
.header("Authorization", "Basic dGVhbWxlYWRfMTp0ZWFtbGVhZF8x"))
.andExpect(MockMvcResultMatchers.status().isNoContent())

View File

@ -230,7 +230,7 @@ class WorkbasketControllerIntTest {
ResponseEntity<?> response =
template.exchange(
restHelper.toUrl(
Mapping.URL_WORKBASKET_DISTRIBUTION_ID, "WBI:100000000000000000000000000000000007"),
Mapping.URL_WORKBASKET_ID_DISTRIBUTION, "WBI:100000000000000000000000000000000007"),
HttpMethod.DELETE,
restHelper.defaultRequest(),
Void.class);

View File

@ -111,7 +111,7 @@ class WorkbasketResourceAssemblerTest {
.isEqualTo(Mapping.URL_WORKBASKET);
assertThat(workbasket.getRequiredLink("removeDistributionTargets").getHref())
.isEqualTo(
Mapping.URL_WORKBASKET_DISTRIBUTION_ID.replaceAll(
Mapping.URL_WORKBASKET_ID_DISTRIBUTION.replaceAll(
"\\{.*}", workbasket.getWorkbasketId()));
}