Skip to content

Commit a966c64

Browse files
authored
Refactor ClusterContextManagerBuilderTest and StandaloneContextManagerBuilderTest (#34981)
1 parent 7ab1fde commit a966c64

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilderTest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.shardingsphere.mode.manager.cluster;
1919

2020
import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
21-
import org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguration;
2221
import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
2322
import org.apache.shardingsphere.infra.instance.metadata.jdbc.JDBCInstanceMetaData;
2423
import org.apache.shardingsphere.infra.instance.metadata.proxy.ProxyInstanceMetaData;
@@ -78,8 +77,6 @@ private void assertBuild(final InstanceMetaData instanceMetaData) throws SQLExce
7877
}
7978

8079
private static ModeConfiguration createModeConfiguration() {
81-
PersistRepositoryConfiguration repositoryConfig = mock(ClusterPersistRepositoryConfiguration.class);
82-
when(repositoryConfig.getType()).thenReturn("FIXTURE");
83-
return new ModeConfiguration("CLUSTER", repositoryConfig);
80+
return new ModeConfiguration("CLUSTER", new ClusterPersistRepositoryConfiguration("FIXTURE", "", "", new Properties()));
8481
}
8582
}

mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.shardingsphere.mode.manager.standalone;
1919

2020
import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
21-
import org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguration;
2221
import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
2322
import org.apache.shardingsphere.infra.instance.metadata.jdbc.JDBCInstanceMetaData;
2423
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
@@ -36,7 +35,6 @@
3635
import static org.hamcrest.CoreMatchers.is;
3736
import static org.hamcrest.MatcherAssert.assertThat;
3837
import static org.mockito.Mockito.mock;
39-
import static org.mockito.Mockito.when;
4038

4139
class StandaloneContextManagerBuilderTest {
4240

@@ -59,8 +57,6 @@ void assertBuild(final ContextManagerBuilder builder) throws SQLException {
5957
}
6058

6159
private static ModeConfiguration createModeConfiguration() {
62-
PersistRepositoryConfiguration repositoryConfig = mock(StandalonePersistRepositoryConfiguration.class);
63-
when(repositoryConfig.getType()).thenReturn("FIXTURE");
64-
return new ModeConfiguration("STANDALONE", repositoryConfig);
60+
return new ModeConfiguration("STANDALONE", new StandalonePersistRepositoryConfiguration("FIXTURE", new Properties()));
6561
}
6662
}

0 commit comments

Comments
 (0)