use of org.hisp.dhis.analytics.DataQueryService in project dhis2-core by dhis2.
the class AnalyticsControllerTest method setUp.
@BeforeEach
public void setUp() {
final DataQueryService dataQueryService = new DefaultDataQueryService(mock(IdentifiableObjectManager.class), mock(OrganisationUnitService.class), dimensionService, mock(AnalyticsSecurityManager.class), mock(SystemSettingManager.class), mock(AclService.class), mock(CurrentUserService.class), mock(I18nManager.class));
// Controller under test
final AnalyticsController controller = new AnalyticsController(dataQueryService, analyticsService, contextUtils);
mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
// When
when(dimensionService.getDataDimensionalItemObject(IdScheme.UID, "fbfJHSPpUQD")).thenReturn(new DataElement("alfa"));
when(dimensionService.getDataDimensionalItemObject(IdScheme.UID, "cYeuwXTCPkU")).thenReturn(new DataElement("beta"));
when(analyticsService.getAggregatedDataValues(Mockito.any(DataQueryParams.class), Mockito.any(), Mockito.any())).thenReturn(buildMockGrid());
}
Aggregations