mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
Revert "fix tests for MasterDataImport"
This reverts commit 01b4423470.
This commit is contained in:
+17
-29
@@ -142,7 +142,6 @@ import com.sap.sailing.server.testsupport.RacingEventServiceImplMock;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Timed;
|
||||
import com.sap.sse.common.TypeBasedServiceFinderFactory;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
@@ -406,7 +405,7 @@ public class MasterDataImportTest {
|
||||
List<String> groupNamesToExport = new ArrayList<String>();
|
||||
groupNamesToExport.add(group.getName());
|
||||
|
||||
RacingEventService destService;
|
||||
RacingEventServiceImplMock destService;
|
||||
DomainFactory domainFactory;
|
||||
DummyMasterDataRessource spyResource = spyResource(new DummyMasterDataRessource(), sourceService);
|
||||
Mockito.doReturn(securityService).when(spyResource).getSecurityService();
|
||||
@@ -421,7 +420,10 @@ public class MasterDataImportTest {
|
||||
// Delete all data above from the database, to allow recreating all of it on target server
|
||||
deleteAllDataFromDatabase();
|
||||
// Import in new service
|
||||
destService = getDestService(randomUUID, serviceFinderFactory);
|
||||
destService = Mockito.spy(
|
||||
new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID), serviceFinderFactory) {
|
||||
});
|
||||
Mockito.doReturn(securityService).when(destService).getSecurityService();
|
||||
|
||||
domainFactory = destService.getBaseDomainFactory();
|
||||
DB db = destService.getMongoObjectFactory().getDatabase();
|
||||
@@ -746,28 +748,10 @@ public class MasterDataImportTest {
|
||||
}
|
||||
|
||||
private RacingEventService getDestService(UUID randomUUID) {
|
||||
RacingEventServiceImplMock destService = new RacingEventServiceImplMock(
|
||||
new DataImportProgressImpl(randomUUID)) {
|
||||
|
||||
@Override
|
||||
public SecurityService getSecurityService() {
|
||||
return MasterDataImportTest.this.securityService;
|
||||
}
|
||||
|
||||
};
|
||||
return destService;
|
||||
}
|
||||
|
||||
private RacingEventService getDestService(UUID randomUUID, TypeBasedServiceFinderFactory serviceFinderFactory) {
|
||||
RacingEventServiceImplMock destService = new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID),
|
||||
serviceFinderFactory) {
|
||||
|
||||
@Override
|
||||
public SecurityService getSecurityService() {
|
||||
return MasterDataImportTest.this.securityService;
|
||||
}
|
||||
|
||||
};
|
||||
RacingEventServiceImplMock destService = Mockito
|
||||
.spy(new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID)) {
|
||||
});
|
||||
Mockito.doReturn(securityService).when(destService).getSecurityService();
|
||||
return destService;
|
||||
}
|
||||
|
||||
@@ -843,7 +827,7 @@ public class MasterDataImportTest {
|
||||
List<String> groupNamesToExport = new ArrayList<String>();
|
||||
groupNamesToExport.add(group.getName());
|
||||
|
||||
RacingEventService destService;
|
||||
RacingEventServiceImplMock destService;
|
||||
DomainFactory domainFactory;
|
||||
DummyMasterDataRessource spyResource = spyResource(new DummyMasterDataRessource(), sourceService);
|
||||
Mockito.doReturn(securityService).when(spyResource).getSecurityService();
|
||||
@@ -858,7 +842,9 @@ public class MasterDataImportTest {
|
||||
// Delete all data above from the database, to allow recreating all of it on target server
|
||||
deleteAllDataFromDatabase();
|
||||
// Import in new service
|
||||
destService = getDestService(randomUUID);
|
||||
destService = Mockito.spy(new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID)) {
|
||||
});
|
||||
Mockito.doReturn(securityService).when(destService).getSecurityService();
|
||||
domainFactory = destService.getBaseDomainFactory();
|
||||
inputStream = new ByteArrayInputStream(os.toByteArray());
|
||||
|
||||
@@ -1905,7 +1891,7 @@ public class MasterDataImportTest {
|
||||
// Serialize
|
||||
List<String> groupNamesToExport = Collections.singletonList(leaderboardGroup.getName());
|
||||
|
||||
RacingEventService destService;
|
||||
RacingEventServiceImplMock destService;
|
||||
DomainFactory domainFactory;
|
||||
DummyMasterDataRessource spyResource = spyResource(new DummyMasterDataRessource(), sourceService);
|
||||
Mockito.doReturn(securityService).when(spyResource).getSecurityService();
|
||||
@@ -1920,7 +1906,9 @@ public class MasterDataImportTest {
|
||||
// Delete all data above from the database, to allow recreating all of it on target server
|
||||
deleteAllDataFromDatabase();
|
||||
// Import in new service
|
||||
destService = getDestService(randomUUID);
|
||||
destService = Mockito.spy(new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID)) {
|
||||
});
|
||||
Mockito.doReturn(securityService).when(destService).getSecurityService();
|
||||
domainFactory = destService.getBaseDomainFactory();
|
||||
inputStream = new ByteArrayInputStream(os.toByteArray());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user