void testRedirectToKnownTargets2() throws Exception {
CreateTransportOrderVO vo = createTO();
postTOAndValidate(vo, NOTLOGGED);
vo.setTarget(UNKNOWN);
given(commonGateway.getLocation(UNKNOWN)).willReturn(Optional.of(INIT_LOC));
<BUG>given(commonGateway.getLocationGroup(UNKNOWN)).willReturn(Optional.of(ERR_LOCGRB));
mockMvc.perform(</BUG>
patch(TMSConstants.ROOT_ENTITIES)
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(vo))

void testRedirectToKnownTargets2() throws Exception {
CreateTransportOrderVO vo = createTO();
postTOAndValidate(vo, NOTLOGGED);
vo.setTarget(UNKNOWN);
given(commonGateway.getLocation(UNKNOWN)).willReturn(Optional.of(INIT_LOC));
given(commonGateway.getLocationGroup(UNKNOWN)).willReturn(Optional.of(ERR_LOCGRB));
sendPatch(vo, status().isNoContent() , "to-patch-target-known-target2");
}
private void sendPatch(CreateTransportOrderVO vo, ResultMatcher rm, String output) throws Exception {
mockMvc.perform(
patch(TMSConstants.ROOT_ENTITIES)
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(vo))
