/**
* Call logAuditError() for code coverage stats.
*/
- @Test
+ @Test(expected = Test.None.class /* no exception expected */)
public void logAuditError() {
LogHelper.INSTANCE.logAuditError(new Exception("test"));
EELFManager.getInstance().getAuditLogger().setLevel(Level.OFF);
assertThat("audit message content", str, containsString("foo"));
}
- @Test
+ @Test(expected = Test.None.class /* no exception expected */)
public void setDefaultContextValue() {
LogHelper logger = LogHelper.INSTANCE;
logger.setDefaultContextValue("key", "value");
*/
private void callUnsupportedOperationMethod(TriConsumer<Enum<?>, LogFields, String[]> logMethod,
ApplicationMsgs dummyMsg) {
- try {
- logMethod.accept(dummyMsg, new LogFields(), new String[] {""});
- org.junit.Assert.fail("method should have thrown execption"); // NOSONAR as code not reached
- } catch (UnsupportedOperationException e) {
- // Expected to reach here
- }
+ logMethod.accept(dummyMsg, new LogFields(), new String[] {""});
+ org.junit.Assert.fail("method should have thrown execption"); // NOSONAR as code not reached
}
/**