Search in sources :

Example 56 with STATUS

use of org.hisp.dhis.dxf2.events.trackedentity.store.query.EventQuery.COLUMNS.STATUS in project dhis2-core by dhis2.

the class TrackedEntityInstanceControllerTest method shouldCallSyncStrategy.

@Test
void shouldCallSyncStrategy() throws Exception {
    when(trackedEntityInstanceSyncStrategy.mergeOrDeleteTrackedEntityInstances(any())).thenReturn(new ImportSummaries());
    mockMvc.perform(post(ENDPOINT).contentType(MediaType.APPLICATION_JSON).content("{}")).andExpect(status().isOk()).andReturn();
    verify(trackedEntityInstanceSyncStrategy, times(1)).mergeOrDeleteTrackedEntityInstances(any());
    verify(trackedEntityInstanceAsyncStrategy, times(0)).mergeOrDeleteTrackedEntityInstances(any());
}
Also used : ImportSummaries(org.hisp.dhis.dxf2.importsummary.ImportSummaries) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)28 User (org.hisp.dhis.user.User)20 ImportSummary (org.hisp.dhis.dxf2.importsummary.ImportSummary)18 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)17 WebMessageException (org.hisp.dhis.dxf2.webmessage.WebMessageException)16 Event (org.hisp.dhis.dxf2.events.event.Event)14 EventSearchParams (org.hisp.dhis.dxf2.events.event.EventSearchParams)10 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)8 ProgramStageInstance (org.hisp.dhis.program.ProgramStageInstance)8 GetMapping (org.springframework.web.bind.annotation.GetMapping)8 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 CategoryOptionCombo (org.hisp.dhis.category.CategoryOptionCombo)6 Enrollment (org.hisp.dhis.dxf2.events.enrollment.Enrollment)6 ImportReport (org.hisp.dhis.dxf2.metadata.feedback.ImportReport)6 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)6 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)5 DataElementCategoryOptionCombo (org.hisp.dhis.dataelement.DataElementCategoryOptionCombo)5 Period (org.hisp.dhis.period.Period)5 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)5