Search in sources :

Example 1 with ProjectSynchronizationService

use of ca.corefacility.bioinformatics.irida.service.remote.ProjectSynchronizationService in project irida by phac-nml.

the class ProjectSynchronizationServiceTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    syncService = new ProjectSynchronizationService(projectService, sampleService, objectService, metadataTemplateService, projectRemoteService, sampleRemoteService, singleEndRemoteService, pairRemoteService, tokenService);
    api = new RemoteAPI();
    expired = new Project();
    expired.setId(1L);
    RemoteStatus expStatus = new RemoteStatus("http://expired", api);
    expStatus.setId(1L);
    expStatus.setLastUpdate(new Date(1));
    expStatus.setSyncStatus(RemoteStatus.SyncStatus.SYNCHRONIZED);
    expired.setSyncFrequency(ProjectSyncFrequency.WEEKLY);
    expired.setRemoteStatus(expStatus);
    upToDate = new Project();
    upToDate.setId(2L);
    RemoteStatus upToDateStatus = new RemoteStatus("http://upToDate", api);
    upToDateStatus.setId(2L);
    upToDateStatus.setLastUpdate(new Date());
    upToDateStatus.setSyncStatus(RemoteStatus.SyncStatus.SYNCHRONIZED);
    upToDate.setSyncFrequency(ProjectSyncFrequency.WEEKLY);
    upToDate.setRemoteStatus(upToDateStatus);
    neverSync = new Project();
    neverSync.setId(3L);
    RemoteStatus neverSyncStatus = new RemoteStatus("http://never", api);
    neverSyncStatus.setId(3L);
    neverSyncStatus.setLastUpdate(new Date());
    neverSyncStatus.setSyncStatus(RemoteStatus.SyncStatus.SYNCHRONIZED);
    neverSync.setSyncFrequency(ProjectSyncFrequency.NEVER);
    neverSync.setRemoteStatus(neverSyncStatus);
}
Also used : RemoteAPI(ca.corefacility.bioinformatics.irida.model.RemoteAPI) Project(ca.corefacility.bioinformatics.irida.model.project.Project) ProjectSynchronizationService(ca.corefacility.bioinformatics.irida.service.remote.ProjectSynchronizationService) RemoteStatus(ca.corefacility.bioinformatics.irida.model.remote.RemoteStatus) Date(java.util.Date) Before(org.junit.Before)

Aggregations

RemoteAPI (ca.corefacility.bioinformatics.irida.model.RemoteAPI)1 Project (ca.corefacility.bioinformatics.irida.model.project.Project)1 RemoteStatus (ca.corefacility.bioinformatics.irida.model.remote.RemoteStatus)1 ProjectSynchronizationService (ca.corefacility.bioinformatics.irida.service.remote.ProjectSynchronizationService)1 Date (java.util.Date)1 Before (org.junit.Before)1