@Test public void getFailureResultsMapThrowable() throws Exception { Map<String, String> result = OutputUtilities.getFailureResultsMap(new Exception("b")); assertEquals(result.get(OutputNames.RETURN_RESULT), "b"); assertTrue(result.get(OutputNames.EXCEPTION).startsWith("java.lang.Exception: b")); assertEquals(result.get(OutputNames.RETURN_CODE), "-1"); }
@NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(OutputNames.EXCEPTION, errorMessage); return results; }
OutputUtilities { @NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(OutputNames.EXCEPTION, errorMessage); return results; } }
OutputUtilities { @NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(OutputNames.EXCEPTION, errorMessage); return results; } private  OutputUtilities(); }
OutputUtilities { @NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(OutputNames.EXCEPTION, errorMessage); return results; } private  OutputUtilities(); @NotNull static Map<String, String> getSuccessResultsMap(@NotNull final String returnResult); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final Throwable throwable); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final String returnResult, @NotNull final Throwable throwable); }
OutputUtilities { @NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(OutputNames.EXCEPTION, errorMessage); return results; } private  OutputUtilities(); @NotNull static Map<String, String> getSuccessResultsMap(@NotNull final String returnResult); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final Throwable throwable); @NotNull static Map<String, String> getFailureResultsMap(@NotNull final String returnResult, @NotNull final Throwable throwable);  }