Search in sources :

Example 1 with OrgUnitActions

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

the class EventImportIdSchemeTests method beforeAll.

@BeforeAll
public void beforeAll() {
    orgUnitActions = new OrgUnitActions();
    eventActions = new EventActions();
    programActions = new ProgramActions();
    attributeActions = new AttributeActions();
    new 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) LoginActions(org.hisp.dhis.actions.LoginActions) EventActions(org.hisp.dhis.actions.tracker.EventActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with OrgUnitActions

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

the class OrgUnitProfileTests method beforeAll.

@BeforeAll
public void beforeAll() {
    loginActions = new LoginActions();
    attributeActions = new AttributeActions();
    orgUnitProfileActions = new RestApiActions("/organisationUnitProfile");
    loginActions.loginAsSuperUser();
    orgUnitId = new OrgUnitActions().createOrgUnit();
}
Also used : OrgUnitActions(org.hisp.dhis.actions.metadata.OrgUnitActions) RestApiActions(org.hisp.dhis.actions.RestApiActions) AttributeActions(org.hisp.dhis.actions.metadata.AttributeActions) LoginActions(org.hisp.dhis.actions.LoginActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with OrgUnitActions

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

the class OrgUnitsRemovalTest method beforeAll.

@BeforeEach
public void beforeAll() {
    orgUnitActions = new OrgUnitActions();
    orgUnitGroupActions = new RestApiActions("/organisationUnitGroups");
    orgUnitSetActions = new RestApiActions("/organisationUnitGroupSets");
    metadataActions = new MetadataActions();
    new LoginActions().loginAsSuperUser();
    metadataActions.importAndValidateMetadata(new File("src/test/resources/metadata/orgunits/ou_with_group_and_set.json"));
}
Also used : OrgUnitActions(org.hisp.dhis.actions.metadata.OrgUnitActions) RestApiActions(org.hisp.dhis.actions.RestApiActions) MetadataActions(org.hisp.dhis.actions.metadata.MetadataActions) LoginActions(org.hisp.dhis.actions.LoginActions) File(java.io.File) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with OrgUnitActions

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

the class EventValidationTests method setupData.

private void setupData() {
    eventProgramStageId = programActions.programStageActions.get("", new QueryParamsBuilder().add("filter=program.id:eq:" + eventProgramId)).extractString("programStages.id[0]");
    assertNotNull(eventProgramStageId, "Failed to find a program stage");
    trackerProgramStageId = programActions.programStageActions.get("", new QueryParamsBuilder().addAll("filter=program.id:eq:" + trackerProgramId, "filter=repeatable:eq:true")).extractString("programStages.id[0]");
    ouIdWithoutAccess = new OrgUnitActions().createOrgUnit();
    new UserActions().grantCurrentUserAccessToOrgUnit(ouIdWithoutAccess);
    enrollment = trackerActions.postAndGetJobReport(new TeiDataBuilder().buildWithEnrollment(OU_ID, trackerProgramId)).validateSuccessfulImport().extractImportedEnrollments().get(0);
}
Also used : OrgUnitActions(org.hisp.dhis.actions.metadata.OrgUnitActions) TeiDataBuilder(org.hisp.dhis.tracker.importer.databuilder.TeiDataBuilder) QueryParamsBuilder(org.hisp.dhis.helpers.QueryParamsBuilder) UserActions(org.hisp.dhis.actions.UserActions)

Example 5 with OrgUnitActions

use of org.hisp.dhis.actions.metadata.OrgUnitActions 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)

Aggregations

OrgUnitActions (org.hisp.dhis.actions.metadata.OrgUnitActions)8 LoginActions (org.hisp.dhis.actions.LoginActions)5 AttributeActions (org.hisp.dhis.actions.metadata.AttributeActions)3 BeforeAll (org.junit.jupiter.api.BeforeAll)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 RestApiActions (org.hisp.dhis.actions.RestApiActions)2 UserActions (org.hisp.dhis.actions.UserActions)2 ProgramActions (org.hisp.dhis.actions.metadata.ProgramActions)2 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 File (java.io.File)1 ApiTest (org.hisp.dhis.ApiTest)1 MetadataActions (org.hisp.dhis.actions.metadata.MetadataActions)1 EventActions (org.hisp.dhis.actions.tracker.EventActions)1 JsonObjectBuilder (org.hisp.dhis.helpers.JsonObjectBuilder)1 QueryParamsBuilder (org.hisp.dhis.helpers.QueryParamsBuilder)1 TeiDataBuilder (org.hisp.dhis.tracker.importer.databuilder.TeiDataBuilder)1 Test (org.junit.jupiter.api.Test)1