test_class.declarator: dataSourceStateChangedListener
test_class.modifier: private
test_class.original_string: private DataSourceStateChangedListener dataSourceStateChangedListener;
test_class.type: DataSourceStateChangedListener
test_class.var_name: dataSourceStateChangedListener
test_class.declarator: registryRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RegistryRepository registryRepository;
test_class.type: RegistryRepository
test_class.var_name: registryRepository
test_class.file: shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-registry/src/test/java/org/apache/shardingsphere/governance/core/registry/listener/DataSourceStateChangedListenerTest.java
test_class.identifier: DataSourceStateChangedListenerTest
test_case.body: @Test
      public void assertCreateGovernanceEvent() {
          Optional<GovernanceEvent> actual = dataSourceStateChangedListener.createGovernanceEvent(
                  new DataChangedEvent("/states/datanodes/primary_replica_db/replica_ds_0", "disabled", ChangedType.UPDATED));
          assertTrue(actual.isPresent());
          assertThat(((DisabledStateChangedEvent) actual.get()).getGovernanceSchema().getSchemaName(), is(new GovernanceSchema("primary_replica_db", "replica_ds_0").getSchemaName()));
      }
test_case.class_method_signature: DataSourceStateChangedListenerTest.assertCreateGovernanceEvent()
test_case.full_signature: @Test public void assertCreateGovernanceEvent()
test_case.identifier: assertCreateGovernanceEvent
test_case.invocations: createGovernanceEvent assertTrue isPresent assertThat getSchemaName getGovernanceSchema get is getSchemaName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertCreateGovernanceEvent()
focal_class.declarator: registryCenterNode
focal_class.modifier: private final
focal_class.original_string: private final RegistryCenterNode registryCenterNode;
focal_class.type: RegistryCenterNode
focal_class.var_name: registryCenterNode
focal_class.file: shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-registry/src/main/java/org/apache/shardingsphere/governance/core/registry/listener/DataSourceStateChangedListener.java
focal_class.identifier: DataSourceStateChangedListener
focal_class.class_method_signature: DataSourceStateChangedListener.DataSourceStateChangedListener(final RegistryRepository registryRepository, final Collection<String> schemaNames)
focal_class.full_signature: public  DataSourceStateChangedListener(final RegistryRepository registryRepository, final Collection<String> schemaNames)
focal_class.identifier: DataSourceStateChangedListener
focal_class.modifiers: public
focal_class.parameters: (final RegistryRepository registryRepository, final Collection<String> schemaNames)
focal_class.signature:  DataSourceStateChangedListener(final RegistryRepository registryRepository, final Collection<String> schemaNames)
focal_class.class_method_signature: DataSourceStateChangedListener.createGovernanceEvent(final DataChangedEvent event)
focal_class.full_signature: @Override protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event)
focal_class.identifier: createGovernanceEvent
focal_class.modifiers: @Override protected
focal_class.parameters: (final DataChangedEvent event)
focal_class.return: Optional<GovernanceEvent>
focal_class.signature: Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event)
focal_class.class_method_signature: DataSourceStateChangedListener.isDataSourceDisabled(final DataChangedEvent event)
focal_class.full_signature: private boolean isDataSourceDisabled(final DataChangedEvent event)
focal_class.identifier: isDataSourceDisabled
focal_class.modifiers: private
focal_class.parameters: (final DataChangedEvent event)
focal_class.return: boolean
focal_class.signature: boolean isDataSourceDisabled(final DataChangedEvent event)
focal_class.superclass: extends PostGovernanceRepositoryEventListener
focal_method.body: @Override
      protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event) {
          return registryCenterNode.getGovernanceSchema(event.getKey()).map(schema -> new DisabledStateChangedEvent(schema, isDataSourceDisabled(event)));
      }
focal_method.class_method_signature: DataSourceStateChangedListener.createGovernanceEvent(final DataChangedEvent event)
focal_method.full_signature: @Override protected Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event)
focal_method.identifier: createGovernanceEvent
focal_method.invocations: map getGovernanceSchema getKey isDataSourceDisabled
focal_method.modifiers: @Override protected
focal_method.parameters: (final DataChangedEvent event)
focal_method.return: Optional<GovernanceEvent>
focal_method.signature: Optional<GovernanceEvent> createGovernanceEvent(final DataChangedEvent event)