LoggingLevelConverter implements Converter<Slf4jReporter.LoggingLevel> { @Override public String convertTo(Slf4jReporter.LoggingLevel value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return value.name(); }  @Override Slf4jReporter.LoggingLevel convertFrom(String value); @Override String convertTo(Slf4jReporter.LoggingLevel value);  }
@Test public void convertTo() throws Exception { assertEquals("ERROR", new LoggingLevelConverter().convertTo(Slf4jReporter.LoggingLevel.ERROR)); }
@Test public void convertToWithNull() throws Exception { expectedException.expect(ParameterException.class); expectedException.expectMessage("Couldn't convert \"null\" to string."); new LoggingLevelConverter().convertTo(null); }