mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 02:06:18 +01:00
Multiply floating store factories for type safety
This commit is contained in:
@@ -67,7 +67,7 @@ public class AutoCompleteResourceTest {
|
||||
xmlDB = mock(XmlDatabase.class);
|
||||
when(storeConfig.get()).thenReturn(xmlDB);
|
||||
when(storeFactory.getStore(any())).thenReturn(storeConfig);
|
||||
when(storeFactory.withName(any())).thenCallRealMethod();
|
||||
when(storeFactory.withType(any())).thenCallRealMethod();
|
||||
XmlUserDAO userDao = new XmlUserDAO(storeFactory);
|
||||
this.userDao = spy(userDao);
|
||||
XmlGroupDAO groupDAO = new XmlGroupDAO(storeFactory);
|
||||
|
||||
@@ -126,8 +126,8 @@ public class SecureKeyResolverTest
|
||||
{
|
||||
ConfigurationEntryStoreFactory factory = mock(ConfigurationEntryStoreFactory.class);
|
||||
|
||||
when(factory.withName(any())).thenCallRealMethod();
|
||||
when(factory.getStore(argThat(storeParameters -> {
|
||||
when(factory.withType(any())).thenCallRealMethod();
|
||||
when(factory.<SecureKey>getStore(argThat(storeParameters -> {
|
||||
assertThat(storeParameters.getName()).isEqualTo(SecureKeyResolver.STORE_NAME);
|
||||
assertThat(storeParameters.getType()).isEqualTo(SecureKey.class);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user