RegistryListenerManager { public void initListeners() { instanceStateChangedListener.watch(ChangedType.UPDATED); dataSourceStateChangedListener.watch(ChangedType.UPDATED, ChangedType.DELETED, ChangedType.ADDED); } RegistryListenerManager(final RegistryRepository registryRepository, final Collection<String> schemaNames); void initListeners();  }
@Test public void assertInitListeners() { RegistryListenerManager actual = new RegistryListenerManager(registryRepository, Arrays.asList("sharding_db", "primary_replica_replication_db", "encrypt_db")); FieldUtil.setField(actual, "instanceStateChangedListener", instanceStateChangedListener); FieldUtil.setField(actual, "dataSourceStateChangedListener", dataSourceStateChangedListener); actual.initListeners(); verify(instanceStateChangedListener).watch(ChangedType.UPDATED); verify(dataSourceStateChangedListener).watch(ChangedType.UPDATED, ChangedType.DELETED, ChangedType.ADDED); }