@Override
  public void error(final ErrorMessage msg) {
    inner.error(() -> throwIfNotRightSchema(msg.get(config)));
  }
@Test
  public void shouldThrowOnBadSchema() {
    // Given:
    when(msg.schema()).thenReturn(Schema.OPTIONAL_STRING_SCHEMA);

    processingLogger.error(errorMsg);

    verify(innerLogger).error(msgCaptor.capture());
    final Supplier<SchemaAndValue> supplier = msgCaptor.getValue();

    // When:
    assertThrows(
        RuntimeException.class,
        supplier::get
    );
  }