ValidationReportUtils { public static boolean isJSONValid(String json) { if (json == null) { return false; } try { new JSONObject(json); } catch (JSONException e) { return false; } return true; }  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 givenNullJSONStringReturnsFalse() throws Exception { assertThat(ValidationReportUtils.isJSONValid(null)).isFalse(); }
@Test public void givenValidJSONStringReturnsTrue() throws Exception { final String json = "{\"validSignaturesCount\": null, \"signaturesCount\": null}"; assertThat(ValidationReportUtils.isJSONValid(json)).isTrue(); }
@Test public void givenStringToIsJSONNullReturnsFalse() throws Exception { assertThat(ValidationReportUtils.isJSONValid("random string")).isFalse(); }