@@ -0,0 +1,3095 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.shardingsphere.singletable.rule.builder;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.Properties;%0Aimport org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;%0Aimport org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;%0Aimport org.apache.shardingsphere.infra.rule.ShardingSphereRule;%0Aimport org.apache.shardingsphere.infra.rule.builder.schema.SchemaRuleBuilder;%0Aimport org.apache.shardingsphere.infra.rule.builder.schema.SchemaRulesBuilderMaterials;%0Aimport org.apache.shardingsphere.infra.rule.identifier.scope.SchemaRule;%0Aimport org.apache.shardingsphere.singletable.config.SingleTableRuleConfiguration;%0Aimport org.apache.shardingsphere.singletable.rule.SingleTableRule;%0Aimport org.apache.shardingsphere.spi.ShardingSphereServiceLoader;%0Aimport org.apache.shardingsphere.spi.ordered.OrderedSPIRegistry;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0Aimport static org.hamcrest.CoreMatchers.instanceOf;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic final class SingleTableRuleBuilderTest %7B%0A%0A    static %7B%0A        ShardingSphereServiceLoader.register(SchemaRuleBuilder.class);%0A    %7D%0A%0A    @Test%0A    public void assertBuild() %7B%0A        Collection%3CSchemaRuleBuilder%3E registeredServiceBuilders = OrderedSPIRegistry.getRegisteredServices(SchemaRuleBuilder.class);%0A        SchemaRuleBuilder builder = registeredServiceBuilders.iterator().next();%0A        SchemaRulesBuilderMaterials materials = mock(SchemaRulesBuilderMaterials.class);%0A        Properties properties = new Properties();%0A        properties.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(), %22false%22);%0A        when(materials.getProps()).thenReturn(new ConfigurationProperties(properties));%0A        SingleTableRuleConfiguration configuration = mock(SingleTableRuleConfiguration.class);%0A        ShardingSphereRule shardingSphereRule = mock(ShardingSphereRule.class);%0A        SchemaRule schemaRule = builder.build(materials, configuration, Arrays.asList(shardingSphereRule));%0A        assertThat(schemaRule, instanceOf(SingleTableRule.class));%0A    %7D%0A%7D%0A

FIX #12216 issue add unit test (#12234)