Skip to content

Commit

Permalink
Simplify usages of mock ShardingSphereDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Dec 4, 2024
1 parent 80e257a commit 40b4e13
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,8 @@ private EncryptRuleConfiguration createCurrentRuleConfigurationWithMultipleTable
}

private ContextManager mockContextManager(final EncryptRule rule) {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getName()).thenReturn("foo_db");
when(database.getRuleMetaData()).thenReturn(new RuleMetaData(Collections.singleton(rule)));
ContextManager result = mock(ContextManager.class, RETURNS_DEEP_STUBS);
ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", mock(), mock(), new RuleMetaData(Collections.singleton(rule)), Collections.emptyList());
when(result.getDatabase("foo_db")).thenReturn(database);
return result;
}
Expand Down

0 comments on commit 40b4e13

Please sign in to comment.