ValidationReportUtils { public static String handleMissingJSON() throws JsonProcessingException { return new ObjectMapper().writer().writeValueAsString(new ServiceError(GENERIC_ERROR, "No JSON found in SiVa API response")); }  static String getValidateFilename(final String reportJSON); static List<String> getValidationWarnings(final String jsonValidationResult); static String getOverallValidationResult(final String reportJSON); static String handleMissingJSON(); static boolean isJSONValid(String json);  }
@Test public void whenHandleMissingJSONIsCalledErrorJSONWillBeReturned() throws Exception { assertThat(ValidationReportUtils.handleMissingJSON()).contains("errorMessage"); assertThat(ValidationReportUtils.handleMissingJSON()).contains("No JSON found in SiVa API response"); }