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"; URL_WORKBASKET_ID + "/workbasketAccessItems";
public static final String URL_WORKBASKET_ID_DISTRIBUTION = public static final String URL_WORKBASKET_ID_DISTRIBUTION =
URL_WORKBASKET_ID + "/distribution-targets"; 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"; public static final String URL_WORKBASKETDEFIITIONS = PRE + "workbasket-definitions";
private Mapping() {} private Mapping() {}

View File

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

View File

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

View File

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

View File

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