Search in sources :

Example 11 with Dhis2MockServer

use of org.hisp.dhis.android.core.data.server.Dhis2MockServer in project dhis2-android-sdk by dhis2.

the class UserAuthenticateCallMockIntegrationShould method setUp.

@Before
@Override
public void setUp() throws IOException {
    super.setUp();
    dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
    D2 d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
    dhis2MockServer.enqueueMockResponse("user.json");
    genericCallData = GenericCallData.create(databaseAdapter(), d2.retrofit());
    authenticateUserCall = UserAuthenticateCall.create(genericCallData, "test_user", "test_password");
}
Also used : Dhis2MockServer(org.hisp.dhis.android.core.data.server.Dhis2MockServer) D2(org.hisp.dhis.android.core.D2) AssetsFileReader(org.hisp.dhis.android.core.data.file.AssetsFileReader) Before(org.junit.Before)

Example 12 with Dhis2MockServer

use of org.hisp.dhis.android.core.data.server.Dhis2MockServer in project dhis2-android-sdk by dhis2.

the class TrackedEntityInstanceCallMockIntegrationShould method setUp.

@Override
@Before
public void setUp() throws IOException {
    super.setUp();
    dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
    d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
}
Also used : Dhis2MockServer(org.hisp.dhis.android.core.data.server.Dhis2MockServer) AssetsFileReader(org.hisp.dhis.android.core.data.file.AssetsFileReader) Before(org.junit.Before)

Aggregations

Dhis2MockServer (org.hisp.dhis.android.core.data.server.Dhis2MockServer)12 Before (org.junit.Before)12 AssetsFileReader (org.hisp.dhis.android.core.data.file.AssetsFileReader)9 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 D2 (org.hisp.dhis.android.core.D2)3 ResourcesFileReader (org.hisp.dhis.android.core.data.file.ResourcesFileReader)3 ContentValues (android.content.ContentValues)2 Date (java.util.Date)2 ResourceStoreImpl (org.hisp.dhis.android.core.resource.ResourceStoreImpl)2 User (org.hisp.dhis.android.core.user.User)2 Retrofit (retrofit2.Retrofit)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 MediaType (okhttp3.MediaType)1 MetadataCall (org.hisp.dhis.android.core.calls.MetadataCall)1 CategoryComboService (org.hisp.dhis.android.core.category.CategoryComboService)1 CategoryService (org.hisp.dhis.android.core.category.CategoryService)1 ObjectStyle (org.hisp.dhis.android.core.common.ObjectStyle)1