AuthenticationChangedListener extends PostGovernanceRepositoryEventListener { @Override protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event) { return Optional.of(new AuthenticationChangedEvent(new AuthenticationYamlSwapper().swapToObject(YamlEngine.unmarshal(event.getValue(), YamlAuthenticationConfiguration.class)))); } AuthenticationChangedListener(final ConfigurationRepository configurationRepository);   }
@Test public void assertCreateGovernanceEvent() { Optional<GovernanceEvent> actual = authenticationChangedListener.createGovernanceEvent(new DataChangedEvent("test", AUTHENTICATION_YAML, ChangedType.UPDATED)); assertTrue(actual.isPresent()); assertThat(((AuthenticationChangedEvent) actual.get()).getAuthentication().getUsers().get("root1").getPassword(), is("root1")); }