PropertiesChangedListener extends PostGovernanceRepositoryEventListener { @Override protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event) { return Optional.of(new PropertiesChangedEvent(YamlEngine.unmarshalProperties(event.getValue()))); } PropertiesChangedListener(final ConfigurationRepository configurationRepository);   }
@Test public void assertCreateGovernanceEvent() { Optional<GovernanceEvent> actual = propertiesChangedListener.createGovernanceEvent(new DataChangedEvent("test", PROPERTIES_YAML, ChangedType.UPDATED)); assertTrue(actual.isPresent()); assertThat(((PropertiesChangedEvent) actual.get()).getProps().get(ConfigurationPropertyKey.SQL_SHOW.getKey()), is(true)); assertThat(((PropertiesChangedEvent) actual.get()).getProps().get(ConfigurationPropertyKey.ACCEPTOR_SIZE.getKey()), is(16)); }