Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise #17695 #17700

Merged
merged 1 commit into from
May 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package org.apache.shardingsphere.infra.datanode;

import org.apache.shardingsphere.infra.fixture.TestDataSourceContainedDataNodeBuilder;
import org.apache.shardingsphere.infra.fixture.TestShardingSphereRule;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.junit.Test;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;

Expand All @@ -32,13 +32,12 @@

public final class DataNodeBuilderFactoryTest {

@SuppressWarnings("rawtypes")
@Test
public void assertGetInstances() {
TestShardingSphereRule key = mock(TestShardingSphereRule.class);
Collection<ShardingSphereRule> rules = Collections.singletonList(key);
Map<ShardingSphereRule, DataNodeBuilder> actual = DataNodeBuilderFactory.getInstances(rules);
TestShardingSphereRule rule = mock(TestShardingSphereRule.class);
Map<ShardingSphereRule, DataNodeBuilder> actual = DataNodeBuilderFactory.getInstances(Collections.singleton(rule));
assertThat(actual.size(), is(1));
assertThat(actual.get(key), instanceOf(DataNodeBuilder.class));
assertThat(actual.get(rule), instanceOf(TestDataSourceContainedDataNodeBuilder.class));
}

}