use of org.hisp.dhis.android.core.trackedentity.TrackedEntityAttributeStore in project dhis2-android-sdk by dhis2.
the class ProgramCallMockIntegrationShould method setUp.
@Override
@Before
public void setUp() throws IOException {
super.setUp();
dhis2MockServer = new Dhis2MockServer(new AssetsFileReader());
D2 d2 = D2Factory.create(dhis2MockServer.getBaseEndpoint(), databaseAdapter());
dhis2MockServer.enqueueMockResponse("programs_complete.json");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setDateFormat(BaseIdentifiableObject.DATE_FORMAT.raw());
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
TrackedEntityAttributeStore trackedEntityAttributeStore = new TrackedEntityAttributeStoreImpl(databaseAdapter());
ProgramTrackedEntityAttributeStore programTrackedEntityAttributeStore = new ProgramTrackedEntityAttributeStoreImpl(databaseAdapter());
ProgramRuleVariableStore programRuleVariableStore = new ProgramRuleVariableStoreImpl(databaseAdapter());
ProgramIndicatorStore programIndicatorStore = new ProgramIndicatorStoreImpl(databaseAdapter());
ProgramStageSectionProgramIndicatorLinkStore programStageSectionProgramIndicatorLinkStore = new ProgramStageSectionProgramIndicatorLinkStoreImpl(databaseAdapter());
ProgramRuleActionStore programRuleActionStore = new ProgramRuleActionStoreImpl(databaseAdapter());
ProgramRuleStore programRuleStore = new ProgramRuleStoreImpl(databaseAdapter());
GenericHandler<ObjectStyle, ObjectStyleModel> styleHandler = ObjectStyleHandler.create(databaseAdapter());
DictionaryTableHandler<ValueTypeRendering> renderTypeHandler = ValueTypeRenderingHandler.create(databaseAdapter());
RelationshipTypeStore relationshipStore = new RelationshipTypeStoreImpl(databaseAdapter());
ProgramService programService = d2.retrofit().create(ProgramService.class);
ProgramStore programStore = new ProgramStoreImpl(databaseAdapter());
ResourceStore resourceStore = new ResourceStoreImpl(databaseAdapter());
Set<String> uids = new HashSet<>();
uids.add("uid1");
uids.add("uids2");
ContentValues categoryCombo = CreateCategoryComboUtils.create(1L, "nM3u9s5a52V");
database().insert(CategoryComboModel.TABLE, null, categoryCombo);
ContentValues categoryCombo2 = CreateCategoryComboUtils.create(2L, "x31y45jvIQL");
database().insert(CategoryComboModel.TABLE, null, categoryCombo2);
// inserting tracked entity
ContentValues trackedEntity = CreateTrackedEntityUtils.create(1L, "nEenWmSyUEp");
database().insert(TrackedEntityModel.TABLE, null, trackedEntity);
programCall = new ProgramCall(programService, databaseAdapter(), resourceStore, uids, programStore, new Date(), trackedEntityAttributeStore, programTrackedEntityAttributeStore, programRuleVariableStore, programIndicatorStore, programStageSectionProgramIndicatorLinkStore, programRuleActionStore, programRuleStore, relationshipStore, styleHandler, renderTypeHandler);
}
Aggregations