@Test
public void testProvider() throws IOException {

  LoggerContext context = new LoggerContext();
  context.getStatusManager().add(new OnConsoleStatusListener());
  createExceptionMappingRegistry(context);
  StringWriter writer = new StringWriter();
  JsonGenerator g = mkJsonGenerator(writer);
  ExceptionArgumentsProvider provider = new ExceptionArgumentsProvider();
  provider.setContext(context);
  provider.setFieldName("exception");
  provider.start();
  ILoggingEvent event = mkLoggingEvent(context);
  g.writeStartObject();
  provider.writeTo(g, event);
  g.writeEndObject();
  g.flush();
  g.close();
  String s = writer.toString();
  assertThat(s)
      .isEqualTo(
          "{\"exception\":[{\"name\":\"java.lang.RuntimeException\",\"properties\":{\"message\":\"derp\"}}]}");
}