use of org.hisp.dhis.tracker.DefaultTrackerImportService in project dhis2-core by dhis2.
the class TrackerImporterServiceTest method setUp.
@BeforeEach
public void setUp() {
subject = new DefaultTrackerImportService(trackerBundleService, trackerValidationService, trackerPreprocessService, trackerUserService, notifier);
final List<Event> events = rnd.objects(Event.class, 3).collect(Collectors.toList());
params = TrackerImportParams.builder().events(events).enrollments(new ArrayList<>()).relationships(new ArrayList<>()).trackedEntities(new ArrayList<>()).userId("123").build();
TrackerBundleReport trackerBundleReport = TrackerBundleReport.builder().build();
when(trackerUserService.getUser(anyString())).thenReturn(getUser());
when(trackerBundleService.commit(any(TrackerBundle.class))).thenReturn(trackerBundleReport);
when(trackerValidationService.validate(any(TrackerBundle.class))).thenReturn(new TrackerValidationReport());
when(trackerValidationService.validateRuleEngine(any(TrackerBundle.class))).thenReturn(new TrackerValidationReport());
when(trackerPreprocessService.preprocess(any(TrackerBundle.class))).thenReturn(ParamsConverter.convert(params));
}
Aggregations