@Test public void testResolveExceptionLevel_undefine() { Exception exception = new SystemException("F.i.e", "undefine"); ExceptionLevel actualExceptionLevel = testTarget.resolveExceptionLevel( exception); ExceptionLevel expectedExceptionLevel = ExceptionLevel.ERROR; assertThat(actualExceptionLevel, is(expectedExceptionLevel)); }
@Override public ExceptionLevel resolveExceptionLevel(Exception ex) { String exceptionCode = resolveExceptionCode(ex); if (exceptionCode == null || exceptionCode.isEmpty()) { return ExceptionLevel.ERROR; } String exceptionCodePrefix = exceptionCode.substring(0, 1); if ("e".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.ERROR; } if ("w".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.WARN; } if ("i".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.INFO; } return ExceptionLevel.ERROR; }
DefaultExceptionLevelResolver implements ExceptionLevelResolver { @Override public ExceptionLevel resolveExceptionLevel(Exception ex) { String exceptionCode = resolveExceptionCode(ex); if (exceptionCode == null || exceptionCode.isEmpty()) { return ExceptionLevel.ERROR; } String exceptionCodePrefix = exceptionCode.substring(0, 1); if ("e".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.ERROR; } if ("w".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.WARN; } if ("i".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.INFO; } return ExceptionLevel.ERROR; } }
DefaultExceptionLevelResolver implements ExceptionLevelResolver { @Override public ExceptionLevel resolveExceptionLevel(Exception ex) { String exceptionCode = resolveExceptionCode(ex); if (exceptionCode == null || exceptionCode.isEmpty()) { return ExceptionLevel.ERROR; } String exceptionCodePrefix = exceptionCode.substring(0, 1); if ("e".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.ERROR; } if ("w".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.WARN; } if ("i".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.INFO; } return ExceptionLevel.ERROR; } DefaultExceptionLevelResolver();  DefaultExceptionLevelResolver(
            ExceptionCodeResolver exceptionCodeResolver); }
DefaultExceptionLevelResolver implements ExceptionLevelResolver { @Override public ExceptionLevel resolveExceptionLevel(Exception ex) { String exceptionCode = resolveExceptionCode(ex); if (exceptionCode == null || exceptionCode.isEmpty()) { return ExceptionLevel.ERROR; } String exceptionCodePrefix = exceptionCode.substring(0, 1); if ("e".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.ERROR; } if ("w".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.WARN; } if ("i".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.INFO; } return ExceptionLevel.ERROR; } DefaultExceptionLevelResolver();  DefaultExceptionLevelResolver(
            ExceptionCodeResolver exceptionCodeResolver); void setExceptionCodeResolver(
            ExceptionCodeResolver exceptionCodeResolver); @Override ExceptionLevel resolveExceptionLevel(Exception ex); }
DefaultExceptionLevelResolver implements ExceptionLevelResolver { @Override public ExceptionLevel resolveExceptionLevel(Exception ex) { String exceptionCode = resolveExceptionCode(ex); if (exceptionCode == null || exceptionCode.isEmpty()) { return ExceptionLevel.ERROR; } String exceptionCodePrefix = exceptionCode.substring(0, 1); if ("e".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.ERROR; } if ("w".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.WARN; } if ("i".equalsIgnoreCase(exceptionCodePrefix)) { return ExceptionLevel.INFO; } return ExceptionLevel.ERROR; } DefaultExceptionLevelResolver();  DefaultExceptionLevelResolver(
            ExceptionCodeResolver exceptionCodeResolver); void setExceptionCodeResolver(
            ExceptionCodeResolver exceptionCodeResolver); @Override ExceptionLevel resolveExceptionLevel(Exception ex);  }