use of org.hisp.dhis.android.core.resource.ResourceStoreImpl in project dhis2-android-sdk by dhis2.
the class DataSetEndpointCallRealIntegrationShould method createCall.
private DataSetEndpointCall createCall() {
ResourceHandler resourceHandler = new ResourceHandler(new ResourceStoreImpl(databaseAdapter()));
GenericCallData data = GenericCallData.create(databaseAdapter(), resourceHandler, d2.retrofit());
Set<String> uids = new HashSet<>();
uids.add("BfMAe6Itzgt");
uids.add("Lpw6GcnTrmS");
uids.add("TuL8IOPzpHh");
return DataSetEndpointCall.FACTORY.create(data, uids);
}
use of org.hisp.dhis.android.core.resource.ResourceStoreImpl in project dhis2-android-sdk by dhis2.
the class ProgramAccessEndpointCallRealIntegrationShould method createCall.
private ProgramAccessEndpointCall createCall() {
ResourceHandler resourceHandler = new ResourceHandler(new ResourceStoreImpl(databaseAdapter()));
GenericCallData data = GenericCallData.create(databaseAdapter(), resourceHandler, d2.retrofit());
ProgramService service = d2.retrofit().create(ProgramService.class);
return ProgramAccessEndpointCall.FACTORY.create(data, service);
}
use of org.hisp.dhis.android.core.resource.ResourceStoreImpl in project dhis2-android-sdk by dhis2.
the class TrackerDataCallMockIntegrationShould method setUp.
@Override
@Before
public void setUp() throws IOException {
super.setUp();
dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
trackedEntityInstanceStore = new TrackedEntityInstanceStoreImpl(databaseAdapter());
resourceStore = new ResourceStoreImpl(databaseAdapter());
enrollmentStore = new EnrollmentStoreImpl(databaseAdapter());
}
use of org.hisp.dhis.android.core.resource.ResourceStoreImpl in project dhis2-android-sdk by dhis2.
the class HandlerFactory method createResourceHandler.
public static ResourceHandler createResourceHandler(DatabaseAdapter databaseAdapter) {
ResourceStore resourceStore = new ResourceStoreImpl(databaseAdapter);
ResourceHandler resourceHandler = new ResourceHandler(resourceStore);
return resourceHandler;
}
use of org.hisp.dhis.android.core.resource.ResourceStoreImpl in project dhis2-android-sdk by dhis2.
the class CategoryEndpointCallShould method provideCategoryEndpointCall.
private CategoryEndpointCall provideCategoryEndpointCall() {
CategoryQuery query = CategoryQuery.builder().paging(true).pageSize(CategoryQuery.DEFAULT_PAGE_SIZE).page(1).build();
ResponseValidator<Category> validator = new ResponseValidator<>();
CategoryStore store = new CategoryStoreImpl(databaseAdapter());
CategoryOptionStore categoryOptionStore = new CategoryOptionStoreImpl(databaseAdapter());
CategoryOptionHandler categoryOptionHandler = new CategoryOptionHandler(categoryOptionStore);
CategoryCategoryOptionLinkStore categoryCategoryOptionLinkStore = new CategoryCategoryOptionLinkStoreImpl(databaseAdapter());
CategoryHandler handler = new CategoryHandler(store, categoryOptionHandler, categoryCategoryOptionLinkStore);
ResourceStore resourceStore = new ResourceStoreImpl(databaseAdapter());
ResourceHandler resourceHandler = new ResourceHandler(resourceStore);
Date serverDate = new Date();
return new CategoryEndpointCall(query, categoryService, validator, handler, resourceHandler, databaseAdapter(), serverDate);
}
Aggregations