use of com.epam.ta.reportportal.ws.controller.constants.ValidationTestsConstants.INCORRECT_REQUEST_MESSAGE in project service-api by reportportal.
the class BugTrackingSystemControllerTest method shouldNotCreateIssueWhenMoreThen300BackLinks.
@Test
void shouldNotCreateIssueWhenMoreThen300BackLinks() throws Exception {
final PostTicketRQ request = new PostTicketRQ();
final Map<Long, String> backLinks = LongStream.range(1, 302).boxed().collect(Collectors.toMap(it -> it, String::valueOf));
request.setBackLinks(backLinks);
final MvcResult mvcResult = mockMvc.perform(post("/v1/bts/superadmin_personal/10/ticket").with(token(oAuthHelper.getSuperadminToken())).contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsBytes(request))).andExpect(status().isBadRequest()).andReturn();
ErrorRS error = objectMapper.readValue(mvcResult.getResponse().getContentAsString(), ErrorRS.class);
assertEquals(INCORRECT_REQUEST, error.getErrorType());
assertEquals(INCORRECT_REQUEST_MESSAGE + "[Field 'backLinks' should have size from '0' to '300'.] ", error.getMessage());
}
Aggregations