use of org.hisp.dhis.android.core.data.file.AssetsFileReader in project dhis2-android-sdk by dhis2.
the class LogoutCallMockIntegrationShould method setUp.
@Override
@Before
public void setUp() throws IOException {
super.setUp();
dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
}
use of org.hisp.dhis.android.core.data.file.AssetsFileReader in project dhis2-android-sdk by dhis2.
the class SingleDataCallMockIntegrationShould method setUp.
@Override
@Before
public void setUp() throws IOException {
super.setUp();
dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
}
use of org.hisp.dhis.android.core.data.file.AssetsFileReader 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");
}
use of org.hisp.dhis.android.core.data.file.AssetsFileReader in project dhis2-android-sdk by dhis2.
the class TrackedEntityInstanceCallMockIntegrationShould method parseTrackedEntityInstanceResponse.
private TrackedEntityInstance parseTrackedEntityInstanceResponse(String file) throws IOException {
String expectedEventsResponseJson = new AssetsFileReader().getStringFromFile(file);
ObjectMapper objectMapper = new ObjectMapper().setDateFormat(BaseIdentifiableObject.DATE_FORMAT.raw());
TrackedEntityInstance trackedEntityInstance = objectMapper.readValue(expectedEventsResponseJson, new TypeReference<TrackedEntityInstance>() {
});
trackedEntityInstance = removeDeletedData(trackedEntityInstance);
return trackedEntityInstance;
}
use of org.hisp.dhis.android.core.data.file.AssetsFileReader 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());
}
Aggregations