mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 08:05:05 +00:00
Fix possible Mockito concurrency issue
This commit is contained in:
parent
563880037e
commit
0e6c1110fa
@ -26,7 +26,7 @@ public void configure(Map<String, Object> props) {
|
||||
super.configure( props );
|
||||
DataSource ds = unwrap( DataSource.class );
|
||||
DataSource dataSource = Mockito.mock(
|
||||
DataSource.class,
|
||||
ds.getClass(),
|
||||
Mockito.withSettings().defaultAnswer( Answers.CALLS_REAL_METHODS ).spiedInstance( ds )
|
||||
);
|
||||
|
||||
@ -34,7 +34,7 @@ public void configure(Map<String, Object> props) {
|
||||
Mockito.doAnswer( invocation -> {
|
||||
Connection connection = (Connection) invocation.callRealMethod();
|
||||
Connection connectionSpy = Mockito.mock(
|
||||
Connection.class,
|
||||
connection.getClass(),
|
||||
Mockito.withSettings().defaultAnswer( Answers.CALLS_REAL_METHODS ).spiedInstance( connection )
|
||||
);
|
||||
connectionSpyMap.put( connectionSpy, connection );
|
||||
|
Loading…
x
Reference in New Issue
Block a user