### Question:
Dhis2 implements LmisServer { @Override public List<IndicatorGroup> fetchIndicatorGroups(User user) { Dhis2Endpoint service = dhis2EndPointFactory.getEndPoint(user); IndicatorGroupResponse response = service.fetchIndicatorGroups("id,name,indicators[id, name]", "false"); response.initializeIndicatorGroups(); return response.getIndicatorGroups(); }  @Override UserProfile validateLogin(User user); void writeJson(User user); @Override List<Category> fetchCategories(User user); List<DataSet> fetchDataSets(User user); @Override List<String> fetchOrderReasons(User user); @Override List<OrderType> fetchOrderTypes(User user); @Override List<CommodityActionValue> fetchCommodityActionValues(User user); @Override List<CommodityActionValue> fetchIndicatorValues(User user, List<Commodity> commodities); @Override List<CommodityActionValue> fetchAllocations(User user); @Override DataValueSetPushResponse pushDataValueSet(DataValueSet valueSet, User user); @Override Integer fetchIntegerConstant(User user, String constantKey); @Override String fetchPhoneNumberConstant(User user, String constantKey, String defaultValue); @Override String fetchLatestVersion(); List<CommodityActionValue> convertDataValuesToCommodityActions(List<DataValue> values); List<CommodityActionValue> convertIndicatorValuesToCommodityActions(
            List<List<String>> values, List<CommodityAction> indicatorActions); @Override List<IndicatorGroup> fetchIndicatorGroups(User user); List<Indicator> fetchClientIndicators(User user); static final String SYNC; static final SimpleDateFormat SIMPLE_DATE_FORMAT; }### Answer:
@Test public void shouldFetchIndicatorGroups() throws Exception { setUpSuccessHttpGetRequest(200, "indicatorGroups.json"); List<IndicatorGroup> indicatorGroups = dhis2.fetchIndicatorGroups(new User()); assertThat(indicatorGroups.size(), is(4)); IndicatorGroup indicatorGroup = indicatorGroups.get(0); assertThat(indicatorGroup.getName(), is("BUFFER STOCK")); assertThat(indicatorGroup.getId(), is("VYnBpONirHy")); Indicator indicator = indicatorGroup.getIndicators().get(0); assertThat(indicator.getName(), is("Cotrimoxazole_suspension BUFFER_STOCK")); assertThat(indicator.getId(), is("bufferStock1")); indicatorGroup = indicatorGroups.get(2); assertThat(indicatorGroup.getName(), is("MIN_STOCK_QUANTITY")); assertThat(indicatorGroup.getId(), is("v2t0cGTiWBZ")); indicator = indicatorGroup.getIndicators().get(0); assertThat(indicator.getId(), is("minStockQuantity1")); assertThat(indicator.getName(), is("Cotrimoxazole_suspension MIN_STOCK_QUANTITY")); }