TSK-1125: distributiontargets now produce application/hal-json
This commit is contained in:
parent
5c7d38451c
commit
f64053ec4e
|
|
@ -253,7 +253,8 @@ public class WorkbasketController extends AbstractPagingController {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = Mapping.URL_WORKBASKET_ID_DISTRIBUTION)
|
@GetMapping(path = Mapping.URL_WORKBASKET_ID_DISTRIBUTION,
|
||||||
|
produces = MediaTypes.HAL_JSON_UTF8_VALUE)
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<DistributionTargetListResource> getDistributionTargets(
|
public ResponseEntity<DistributionTargetListResource> getDistributionTargets(
|
||||||
@PathVariable(value = "workbasketId") String workbasketId)
|
@PathVariable(value = "workbasketId") String workbasketId)
|
||||||
|
|
|
||||||
|
|
@ -235,4 +235,20 @@ class WorkbasketControllerIntTest {
|
||||||
.isEqualTo(MediaTypes.HAL_JSON_UTF8_VALUE);
|
.isEqualTo(MediaTypes.HAL_JSON_UTF8_VALUE);
|
||||||
assertThat(response.getBody().getContent()).hasSize(3);
|
assertThat(response.getBody().getContent()).hasSize(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testGetWorkbasketDistributionTargets() {
|
||||||
|
ResponseEntity<DistributionTargetListResource> response =
|
||||||
|
template.exchange(
|
||||||
|
restHelper.toUrl(
|
||||||
|
Mapping.URL_WORKBASKET_ID_DISTRIBUTION, "WBI:100000000000000000000000000000000001"),
|
||||||
|
HttpMethod.GET,
|
||||||
|
restHelper.defaultRequest(),
|
||||||
|
ParameterizedTypeReference.forType(DistributionTargetListResource.class));
|
||||||
|
assertThat(response.getBody().getLink(Link.REL_SELF)).isNotNull();
|
||||||
|
assertThat(response.getHeaders().getContentType().toString())
|
||||||
|
.isEqualTo(MediaTypes.HAL_JSON_UTF8_VALUE);
|
||||||
|
assertThat(response.getBody().getContent()).hasSize(4);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue