mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 09:39:38 +00:00
drop/clear User/AccessContol stores prior to test execution
This commit is contained in:
1 parent
bf1b433831
commit
014a5e12aa
2 files changed
+6
No files matched your search
+2
@@ -93,9 +93,11 @@ public abstract class AbstractStoreMergeTest {
|
||||
cfgForTarget = MongoDBConfiguration.getDefaultTestConfiguration();
|
||||
targetService = cfgForTarget.getService();
|
||||
causallyConsistentSessionForTarget = targetService.startCausallyConsistentSession();
|
||||
new MongoDatabaseWrapperWithClientSession(causallyConsistentSessionForTarget, targetService.getDB()).withReadConcern(ReadConcern.MAJORITY).withWriteConcern(WriteConcern.MAJORITY).drop();
|
||||
cfgForSource = new MongoDBConfiguration(new ConnectionString(importSourceMongoDbUri));
|
||||
sourceService = cfgForSource.getService();
|
||||
causallyConsistentSessionForSource = sourceService.startCausallyConsistentSession();
|
||||
new MongoDatabaseWrapperWithClientSession(causallyConsistentSessionForSource, sourceService.getDB()).withReadConcern(ReadConcern.MAJORITY).withWriteConcern(WriteConcern.MAJORITY).drop();
|
||||
}
|
||||
|
||||
protected void setUp(String sourceVariant, String targetVariant) throws IOException, UserStoreManagementException {
|
||||
|
||||
+4
@@ -32,10 +32,14 @@ public class SecurityServiceAndHasPermissionsProviderTest {
|
||||
|
||||
@Before
|
||||
public void setup() throws UserStoreManagementException {
|
||||
new UserStoreImpl(PersistenceFactory.INSTANCE.getDefaultMajorityDomainObjectFactory(),
|
||||
PersistenceFactory.INSTANCE.getDefaultMajorityMongoObjectFactory(), TEST_DEFAULT_TENANT).clear();
|
||||
userStore = new UserStoreImpl(PersistenceFactory.INSTANCE.getDefaultMajorityDomainObjectFactory(),
|
||||
PersistenceFactory.INSTANCE.getDefaultMajorityMongoObjectFactory(), TEST_DEFAULT_TENANT);
|
||||
userStore.ensureDefaultRolesExist();
|
||||
userStore.loadAndMigrateUsers();
|
||||
new AccessControlStoreImpl(PersistenceFactory.INSTANCE.getDefaultMajorityDomainObjectFactory(),
|
||||
PersistenceFactory.INSTANCE.getDefaultMajorityMongoObjectFactory(), userStore).clear();
|
||||
accessControlStore = new AccessControlStoreImpl(PersistenceFactory.INSTANCE.getDefaultMajorityDomainObjectFactory(),
|
||||
PersistenceFactory.INSTANCE.getDefaultMajorityMongoObjectFactory(), userStore);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user