@Test
public void shouldValidateRequiredValue() {

    AtomicReference<Credentials> credentials = new AtomicReference<>();
    expectedLogEvents.expectPattern(ConfigObserver.class, Level.ERROR, "Failed to notify listener while reloading {}");
    observer.onPrefixedValue("credentials", Credentials::new, credentials::set);
}