@Test public void testBlankCollection() { ErrorCollection ec = new ErrorCollection(); assertEquals("Could not read error message from server", IntercomException.getMessage(ec)); }
public static String getMessage(ErrorCollection errorCollection) { String message = "Could not read error message from server"; if(errorCollection!=null && errorCollection.getErrors() != null && errorCollection.getErrors().size() > 0 && errorCollection.getErrors().get(0) != null && errorCollection.getErrors().get(0).getMessage() != null){ message = errorCollection.getErrors().get(0).getMessage(); } return message; }
IntercomException extends RuntimeException { public static String getMessage(ErrorCollection errorCollection) { String message = "Could not read error message from server"; if(errorCollection!=null && errorCollection.getErrors() != null && errorCollection.getErrors().size() > 0 && errorCollection.getErrors().get(0) != null && errorCollection.getErrors().get(0).getMessage() != null){ message = errorCollection.getErrors().get(0).getMessage(); } return message; } }
IntercomException extends RuntimeException { public static String getMessage(ErrorCollection errorCollection) { String message = "Could not read error message from server"; if(errorCollection!=null && errorCollection.getErrors() != null && errorCollection.getErrors().size() > 0 && errorCollection.getErrors().get(0) != null && errorCollection.getErrors().get(0).getMessage() != null){ message = errorCollection.getErrors().get(0).getMessage(); } return message; } @SuppressWarnings("WeakerAccess")  IntercomException(String message);  IntercomException(String message, Throwable cause);  IntercomException(ErrorCollection errorCollection); @SuppressWarnings("WeakerAccess")  IntercomException(ErrorCollection errorCollection, Throwable cause); }
IntercomException extends RuntimeException { public static String getMessage(ErrorCollection errorCollection) { String message = "Could not read error message from server"; if(errorCollection!=null && errorCollection.getErrors() != null && errorCollection.getErrors().size() > 0 && errorCollection.getErrors().get(0) != null && errorCollection.getErrors().get(0).getMessage() != null){ message = errorCollection.getErrors().get(0).getMessage(); } return message; } @SuppressWarnings("WeakerAccess")  IntercomException(String message);  IntercomException(String message, Throwable cause);  IntercomException(ErrorCollection errorCollection); @SuppressWarnings("WeakerAccess")  IntercomException(ErrorCollection errorCollection, Throwable cause); static String getMessage(ErrorCollection errorCollection); ErrorCollection getErrorCollection(); Error getFirstError(); }
IntercomException extends RuntimeException { public static String getMessage(ErrorCollection errorCollection) { String message = "Could not read error message from server"; if(errorCollection!=null && errorCollection.getErrors() != null && errorCollection.getErrors().size() > 0 && errorCollection.getErrors().get(0) != null && errorCollection.getErrors().get(0).getMessage() != null){ message = errorCollection.getErrors().get(0).getMessage(); } return message; } @SuppressWarnings("WeakerAccess")  IntercomException(String message);  IntercomException(String message, Throwable cause);  IntercomException(ErrorCollection errorCollection); @SuppressWarnings("WeakerAccess")  IntercomException(ErrorCollection errorCollection, Throwable cause); static String getMessage(ErrorCollection errorCollection); ErrorCollection getErrorCollection(); Error getFirstError();  }