class StructuredLoggerImpl implements StructuredLogger {

  public void error(final Supplier<SchemaAndValue> msgSupplier) {
    if (!inner.isErrorEnabled()) {
      return;
    }
    error(msgSupplier.get());
  }

}

class StructuredLoggerImplTest {

  private final static String LOG_MSG;
  @Mock
  private Logger innerLogger;
  @Mock
  private SchemaAndValue msg;
  @Mock
  private Supplier<SchemaAndValue> msgSupplier;
  @Captor
  private ArgumentCaptor<SerializableSchemaAndValue> captor;
  private StructuredLoggerImpl logger;
  @Rule
  public MockitoRule rule;

  @Test
  public void shouldNotGetMessageIfLoggerDisabledForError() {

    // Given:
    when(innerLogger.isErrorEnabled()).thenReturn(false);

    // When:
    logger.error(msgSupplier);

    // Then:
    verify(innerLogger).isErrorEnabled();
    verifyNoMoreInteractions(innerLogger, msgSupplier);
  }

}