Search in sources :

Example 11 with ProgramActions

use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.

the class UserAssignmentTests method beforeAll.

@BeforeAll
public void beforeAll() {
    programActions = new ProgramActions();
    metadataActions = new MetadataActions();
    loginActions.loginAsSuperUser();
    metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/eventProgram.json"));
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) MetadataActions(org.hisp.dhis.actions.metadata.MetadataActions) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 12 with ProgramActions

use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.

the class TeiValidationTests method setupData.

private void setupData() {
    TrackedEntityAttributeActions trackedEntityAttributeActions = new TrackedEntityAttributeActions();
    ProgramActions programActions = new ProgramActions();
    TrackedEntityTypeActions trackedEntityTypeActions = new TrackedEntityTypeActions();
    trackedEntityType = trackedEntityTypeActions.create();
    // create attributes
    uniqueTetAttribute = trackedEntityAttributeActions.create("TEXT", true);
    mandatoryTetAttribute = trackedEntityAttributeActions.create("TEXT");
    mandatoryProgramAttribute = trackedEntityAttributeActions.create("TEXT");
    attributeWithOptionSet = trackedEntityAttributeActions.createOptionSetAttribute("ZGkmoWb77MW");
    trackedEntityTypeActions.addAttribute(trackedEntityType, mandatoryTetAttribute, true);
    trackedEntityTypeActions.addAttribute(trackedEntityType, attributeWithOptionSet, false);
    trackedEntityTypeActions.addAttribute(trackedEntityType, uniqueTetAttribute, false);
    // create a program
    program = programActions.createTrackerProgram(trackedEntityType, Constants.ORG_UNIT_IDS).extractUid();
    programActions.addAttribute(program, mandatoryProgramAttribute, true);
}
Also used : TrackedEntityTypeActions(org.hisp.dhis.actions.metadata.TrackedEntityTypeActions) ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) TrackedEntityAttributeActions(org.hisp.dhis.actions.metadata.TrackedEntityAttributeActions)

Example 13 with ProgramActions

use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.

the class EventImportDataValueValidationTests method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    programActions = new ProgramActions();
    eventActions = new EventActions();
    dataElementActions = new DataElementActions();
    new LoginActions().loginAsAdmin();
    setupData();
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) DataElementActions(org.hisp.dhis.actions.metadata.DataElementActions) LoginActions(org.hisp.dhis.actions.LoginActions) EventActions(org.hisp.dhis.actions.tracker.EventActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 14 with ProgramActions

use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.

the class EventIdSchemeTests method beforeAll.

@BeforeAll
public void beforeAll() {
    orgUnitActions = new OrgUnitActions();
    programActions = new ProgramActions();
    attributeActions = new AttributeActions();
    loginActions.loginAsSuperUser();
    setupData();
}
Also used : OrgUnitActions(org.hisp.dhis.actions.metadata.OrgUnitActions) ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) AttributeActions(org.hisp.dhis.actions.metadata.AttributeActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 15 with ProgramActions

use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.

the class PotentialDuplicatesAttributeMergeTests method beforeEach.

@BeforeEach
public void beforeEach() {
    loginActions.loginAsAdmin();
    attributes = new ProgramActions().get(program, new QueryParamsBuilder().addAll("filter=programTrackedEntityAttributes.valueType:eq:TEXT")).extractList("programTrackedEntityAttributes.trackedEntityAttribute.id", String.class);
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) QueryParamsBuilder(org.hisp.dhis.helpers.QueryParamsBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ProgramActions (org.hisp.dhis.actions.metadata.ProgramActions)19 BeforeAll (org.junit.jupiter.api.BeforeAll)14 LoginActions (org.hisp.dhis.actions.LoginActions)9 EventActions (org.hisp.dhis.actions.tracker.EventActions)6 TrackedEntityAttributeActions (org.hisp.dhis.actions.metadata.TrackedEntityAttributeActions)3 QueryParamsBuilder (org.hisp.dhis.helpers.QueryParamsBuilder)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 JsonObject (com.google.gson.JsonObject)2 File (java.io.File)2 UserActions (org.hisp.dhis.actions.UserActions)2 AttributeActions (org.hisp.dhis.actions.metadata.AttributeActions)2 DataElementActions (org.hisp.dhis.actions.metadata.DataElementActions)2 MetadataActions (org.hisp.dhis.actions.metadata.MetadataActions)2 OrgUnitActions (org.hisp.dhis.actions.metadata.OrgUnitActions)2 Matchers.containsString (org.hamcrest.Matchers.containsString)1 RestApiActions (org.hisp.dhis.actions.RestApiActions)1 AnalyticsEnrollmentsActions (org.hisp.dhis.actions.analytics.AnalyticsEnrollmentsActions)1 AnalyticsEventActions (org.hisp.dhis.actions.analytics.AnalyticsEventActions)1 RelationshipTypeActions (org.hisp.dhis.actions.metadata.RelationshipTypeActions)1 SharingActions (org.hisp.dhis.actions.metadata.SharingActions)1