Skip to content

Commit

Permalink
Refactor ShardingSphereStatisticsFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Jan 17, 2025
1 parent d8435f1 commit e45ce17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void assertCreateWithSelectStatementFromPerformanceSchema() {
private void initProxyContext(final Collection<ShardingSphereDatabase> databases) {
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
ShardingSphereMetaData metaData = new ShardingSphereMetaData(databases, mock(ResourceMetaData.class), mock(RuleMetaData.class), new ConfigurationProperties(new Properties()));
MetaDataContexts metaDataContexts = new MetaDataContexts(metaData, ShardingSphereStatisticsFactory.create(mock(MetaDataPersistService.class), metaData));
MetaDataContexts metaDataContexts = new MetaDataContexts(metaData, ShardingSphereStatisticsFactory.create(mock(MetaDataPersistService.class, RETURNS_DEEP_STUBS), metaData));
when(contextManager.getMetaDataContexts()).thenReturn(metaDataContexts);
when(ProxyContext.getInstance().getContextManager()).thenReturn(contextManager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void assertExecuteUseStatementBackendHandlerWhenSchemaNotExist() {
private ContextManager mockContextManager() {
ContextManager result = mock(ContextManager.class, RETURNS_DEEP_STUBS);
ShardingSphereMetaData metaData = new ShardingSphereMetaData(createDatabases(), mock(), mock(), mock());
MetaDataContexts metaDataContexts = new MetaDataContexts(metaData, ShardingSphereStatisticsFactory.create(mock(MetaDataPersistService.class), metaData));
MetaDataContexts metaDataContexts = new MetaDataContexts(metaData, ShardingSphereStatisticsFactory.create(mock(MetaDataPersistService.class, RETURNS_DEEP_STUBS), metaData));
when(result.getMetaDataContexts()).thenReturn(metaDataContexts);
return result;
}
Expand Down

0 comments on commit e45ce17

Please sign in to comment.