Skip to content

Commit

Permalink
Fix SingleSQLRouterTest (#33146)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Oct 7, 2024
1 parent a795f84 commit 2969e28
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -195,9 +197,7 @@ void assertDecorateRouteContextWithReadwriteSplittingDataSource() {
ShardingSphereDatabase database = new ShardingSphereDatabase(DefaultDatabase.LOGIC_NAME, mock(DatabaseType.class), mock(ResourceMetaData.class, RETURNS_DEEP_STUBS),
new RuleMetaData(Collections.singleton(rule)), Collections.emptyMap());
sqlRouter.decorateRouteContext(routeContext, createQueryContext(), database, rule, new ConfigurationProperties(new Properties()));
Iterator<String> routedDataSourceNames = routeContext.getActualDataSourceNames().iterator();
assertThat(routedDataSourceNames.next(), is("write_ds"));
assertThat(routedDataSourceNames.next(), is("readwrite_ds"));
assertThat(routeContext.getActualDataSourceNames(), is(new HashSet<>(Arrays.asList("write_ds", "readwrite_ds"))));
}

@Test
Expand Down

0 comments on commit 2969e28

Please sign in to comment.