Skip to content

Commit

Permalink
Add ShardingSphereMetaData's constructor with ShardingSphereDatabase …
Browse files Browse the repository at this point in the history
…collection
  • Loading branch information
terrymanu committed Dec 3, 2024
1 parent 2b9ac07 commit 4056456
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ void assertNewInstanceWithSelectStatementForSQLServer() {
}

private void assertNewInstanceWithSelectStatement(final SelectStatement selectStatement) {
ConfigurationProperties props = new ConfigurationProperties(new Properties());
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getName()).thenReturn(DefaultDatabase.LOGIC_NAME);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext sqlStatementContext = new SelectStatementContext(new ShardingSphereMetaData(Collections.singleton(database), mock(), mock(), mock()),
Collections.emptyList(), selectStatement, DefaultDatabase.LOGIC_NAME, Collections.emptyList());
assertThat(new ShardingResultMergerEngine().newInstance(DefaultDatabase.LOGIC_NAME, databaseType, null, props, sqlStatementContext), instanceOf(ShardingDQLResultMerger.class));
assertThat(new ShardingResultMergerEngine().newInstance(DefaultDatabase.LOGIC_NAME, databaseType, null, new ConfigurationProperties(new Properties()), sqlStatementContext),
instanceOf(ShardingDQLResultMerger.class));
}

@Test
Expand Down

0 comments on commit 4056456

Please sign in to comment.