public void dropDatabase(final String databaseName) {
        cleanResources(databases.remove(databaseName));
    }
@Test
    void assertDropDatabase() {
        ResourceMetaData resourceMetaData = mock(ResourceMetaData.class, RETURNS_DEEP_STUBS);
        GlobalRule globalRule = mock(GlobalRule.class);
        MockedDataSource dataSource = new MockedDataSource();
        ShardingSphereRule databaseRule = mock(ShardingSphereRule.class);
        when(databaseRule.getAttributes()).thenReturn(new RuleAttributes());
        ShardingSphereMetaData metaData = new ShardingSphereMetaData(new HashMap<>(Collections.singletonMap("foo_db", mockDatabase(resourceMetaData, dataSource, databaseRule))),
                mock(ResourceMetaData.class), new RuleMetaData(Collections.singleton(globalRule)), new ConfigurationProperties(new Properties()));
        metaData.dropDatabase("foo_db");
        assertTrue(metaData.getDatabases().isEmpty());
        Awaitility.await().pollDelay(10L, TimeUnit.MILLISECONDS).until(dataSource::isClosed);
        assertTrue(dataSource.isClosed());
        verify(globalRule).refresh(metaData.getDatabases(), GlobalRuleChangedType.DATABASE_CHANGED);
    }