ShardingSphereSchema { public boolean isComplete() { return !rules.isEmpty() && !dataSources.isEmpty(); }  boolean isComplete(); void closeDataSources(final Collection<String> dataSources);  }
@Test public void assertIsComplete() { ShardingSphereSchema schema = new ShardingSphereSchema("name", Collections.singleton(mock(RuleConfiguration.class)), Collections.singleton(mock(ShardingSphereRule.class)), Collections.singletonMap("ds", mock(DataSource.class)), mock(ShardingSphereMetaData.class)); assertTrue(schema.isComplete()); }
@Test public void assertIsNotCompleteWithoutRule() { ShardingSphereSchema schema = new ShardingSphereSchema("name", Collections.emptyList(), Collections.emptyList(), Collections.singletonMap("ds", mock(DataSource.class)), mock(ShardingSphereMetaData.class)); assertFalse(schema.isComplete()); }
@Test public void assertIsNotCompleteWithoutDataSource() { ShardingSphereSchema schema = new ShardingSphereSchema("name", Collections.singleton(mock(RuleConfiguration.class)), Collections.singleton(mock(ShardingSphereRule.class)), Collections.emptyMap(), mock(ShardingSphereMetaData.class)); assertFalse(schema.isComplete()); }