@@ -0,0 +1,2804 @@
+package org.hisp.dhis.android.core.datavalue;%0A%0Aimport android.support.test.runner.AndroidJUnit4;%0A%0Aimport org.hisp.dhis.android.core.D2;%0Aimport org.hisp.dhis.android.core.common.D2Factory;%0Aimport org.hisp.dhis.android.core.common.GenericCallData;%0Aimport org.hisp.dhis.android.core.data.database.AbsStoreTestCase;%0Aimport org.hisp.dhis.android.core.resource.ResourceHandler;%0Aimport org.hisp.dhis.android.core.resource.ResourceStoreImpl;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.io.IOException;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0A%0A@RunWith(AndroidJUnit4.class)%0Apublic class DataValueEndpointCallRealIntegrationShould extends AbsStoreTestCase %7B%0A    /**%0A     * A quick integration test that is probably flaky, but will help with finding bugs related to the%0A     * metadataSyncCall. It works against the demo server.%0A     */%0A    private D2 d2;%0A    private DataValueEndpointCall dataValueCall;%0A%0A    @Before%0A    @Override%0A    public void setUp() throws IOException %7B%0A        super.setUp();%0A        d2 = D2Factory.create(%22https://play.dhis2.org/android-current/api/%22, databaseAdapter());%0A        dataValueCall = createCall();%0A    %7D%0A%0A    private DataValueEndpointCall createCall() %7B%0A        ResourceHandler resourceHandler =%0A                new ResourceHandler(new ResourceStoreImpl(databaseAdapter()));%0A        GenericCallData data = GenericCallData.create(databaseAdapter(), resourceHandler, d2.retrofit());%0A%0A        Set%3CString%3E dataSetUids = new HashSet%3C%3E();%0A        dataSetUids.add(%22BfMAe6Itzgt%22);%0A        dataSetUids.add(%22TuL8IOPzpHh%22);%0A%0A        Set%3CString%3E periodIds = new HashSet%3C%3E();%0A        periodIds.add(%22201712%22);%0A        periodIds.add(%222017%22);%0A%0A        Set%3CString%3E orgUnitUids = new HashSet%3C%3E();%0A        orgUnitUids.add(%22DiszpKrYNg8%22);%0A%0A        return DataValueEndpointCall.FACTORY.create(data, dataSetUids, periodIds, orgUnitUids);%0A    %7D%0A%0A    // @Test%0A    public void download_data_values() throws Exception %7B%0A        if (!d2.isUserLoggedIn().call()) %7B%0A            retrofit2.Response loginResponse = d2.logIn(%22android%22, %22Android123%22).call();%0A            assertThat(loginResponse.isSuccessful()).isTrue();%0A        %7D%0A%0A        /*  This test won't pass independently of DataValueEndpointCall and%0A            OrganisationUnitCall, as the foreign keys constraints won't be satisfied.%0A            To run the test, you will need to disable foreign key support in database in%0A            DbOpenHelper.java replacing 'foreign_keys = ON' with 'foreign_keys = OFF' and%0A            uncomment the @Test tag */%0A%0A        retrofit2.Response dataValueResponse = dataValueCall.call();%0A        assertThat(dataValueResponse.isSuccessful()).isTrue();%0A    %7D%0A%0A    @Test%0A    public void stub() %7B%0A    %7D%0A%7D%0A

add DataValueEndpointCallRealIntegrationShould