@Subscribe
    public synchronized void renew(final QualifiedDataSourceStateEvent event) {
        QualifiedDataSource qualifiedDataSource = event.getQualifiedDataSource();
        if (!contextManager.getMetaDataContexts().getMetaData().containsDatabase(qualifiedDataSource.getDatabaseName())) {
            return;
        }
        ShardingSphereDatabase database = contextManager.getMetaDataContexts().getMetaData().getDatabase(qualifiedDataSource.getDatabaseName());
        for (StaticDataSourceRuleAttribute each : database.getRuleMetaData().getAttributes(StaticDataSourceRuleAttribute.class)) {
            each.updateStatus(qualifiedDataSource, event.getStatus().getState());
        }
    }
@Test
    void assertRenewForDisableStateChanged() {
        StaticDataSourceRuleAttribute ruleAttribute = mock(StaticDataSourceRuleAttribute.class);
        when(database.getRuleMetaData().getAttributes(StaticDataSourceRuleAttribute.class)).thenReturn(Collections.singleton(ruleAttribute));
        QualifiedDataSourceStateEvent event = new QualifiedDataSourceStateEvent(new QualifiedDataSource("db.readwrite_ds.ds_0"), new QualifiedDataSourceState(DataSourceState.DISABLED));
        subscriber.renew(event);
        verify(ruleAttribute).updateStatus(
                argThat(qualifiedDataSource -> Objects.equals(event.getQualifiedDataSource(), qualifiedDataSource)),
                argThat(dataSourceState -> event.getStatus().getState() == dataSourceState));
    }