AbstractApi { protected static WebApplicationException createJsonApiException(String message, Response.Status code) { return new WebApplicationException( JsonApiResponse .createExceptionResponse(code) .message(message) .build()); }   static final String API_VERSION; static final String DATASOURCES; static final String FILTERTYPES; static final String USERS; static final String DATA; static final String FILTERCHAINS; static final String PLUGINS; static final String NOTIFICATIONS; static final String VIEWS; static final String ENTRYPOINT; static final String DOC; static final String VIEW; static final String DATASOURCE; static final String BASICAUTH; }
@Test public void testCreateJsonApiException() { WebApplicationException exception = AbstractApi.createJsonApiException(MESSAGE, Response.Status.fromStatusCode(ERRCODE_VALID)); JsonNode result = TestUtils.extractJsonEntity(exception.getResponse()); assertHasValidErrorObj(result); assertExcDocHasValues(result, COMBINED_MESSAGE, ERRCODE_VALID); }
@Test(expected = IllegalArgumentException.class) public void testCreateJsonApiExceptionInvalidCode() { AbstractApi.createJsonApiException(MESSAGE, Response.Status.fromStatusCode(ERRCODE_INVALID)); }