Search in sources :

Example 1 with CrudControllerAdvice

use of org.hisp.dhis.webapi.controller.CrudControllerAdvice in project dhis2-core by dhis2.

the class DeduplicationControllerMvcTest method setUp.

@BeforeEach
void setUp() {
    deduplicationMergeParams = DeduplicationMergeParams.builder().potentialDuplicate(new PotentialDuplicate(teiA, teiB)).original(trackedEntityInstanceA).duplicate(trackedEntityInstanceB).mergeObject(MergeObject.builder().build()).build();
    mockMvc = MockMvcBuilders.standaloneSetup(deduplicationController).setControllerAdvice(new CrudControllerAdvice()).build();
    lenient().when(trackedEntityInstanceService.getTrackedEntityInstance(teiA)).thenReturn(trackedEntityInstanceA);
    lenient().when(trackedEntityInstanceService.getTrackedEntityInstance(teiB)).thenReturn(trackedEntityInstanceB);
    lenient().when(trackerAccessManager.canRead(any(), any(TrackedEntityInstance.class))).thenReturn(Lists.newArrayList());
}
Also used : PotentialDuplicate(org.hisp.dhis.deduplication.PotentialDuplicate) TrackedEntityInstance(org.hisp.dhis.trackedentity.TrackedEntityInstance) CrudControllerAdvice(org.hisp.dhis.webapi.controller.CrudControllerAdvice) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PotentialDuplicate (org.hisp.dhis.deduplication.PotentialDuplicate)1 TrackedEntityInstance (org.hisp.dhis.trackedentity.TrackedEntityInstance)1 CrudControllerAdvice (org.hisp.dhis.webapi.controller.CrudControllerAdvice)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1