Search in sources :

Example 6 with ProgramActions

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

the class EventsDataValueValidationTests method beforeAll.

@BeforeAll
public void beforeAll() {
    programActions = new ProgramActions();
    sharingActions = new SharingActions();
    dataElementActions = new DataElementActions();
    loginActions.loginAsSuperUser();
    setupData();
}
Also used : SharingActions(org.hisp.dhis.actions.metadata.SharingActions) ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) DataElementActions(org.hisp.dhis.actions.metadata.DataElementActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 7 with ProgramActions

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

the class TrackerNtiApiTest method beforeTrackerNti.

@BeforeAll
public void beforeTrackerNti() {
    trackerActions = new TrackerActions();
    loginActions = new LoginActions();
    programActions = new ProgramActions();
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) TrackerActions(org.hisp.dhis.actions.tracker.importer.TrackerActions) LoginActions(org.hisp.dhis.actions.LoginActions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 8 with ProgramActions

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

the class EnrollmentsUpdateTests method shouldNotUpdateImmutableProperties.

@Test
public void shouldNotUpdateImmutableProperties() throws Exception {
    String enrollmentId = importEnrollment();
    String program = new ProgramActions().createProgram("WITH_REGISTRATION").extractUid();
    JsonObject body = trackerActions.get("/enrollments/" + enrollmentId).getBody();
    body = JsonObjectBuilder.jsonObject(body).addProperty("enrollment", enrollmentId).addProperty("trackedEntity", importTei()).addProperty("program", program).wrapIntoArray("enrollments");
    trackerActions.postAndGetJobReport(body, new QueryParamsBuilder().add("importStrategy=UPDATE")).validateErrorReport().body("", hasSize(Matchers.greaterThanOrEqualTo(2))).body("errorCode", hasItems("E1127", "E1127")).body("message", Matchers.hasItem(Matchers.containsString("trackedEntity"))).body("message", Matchers.hasItem(Matchers.containsString("program")));
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) QueryParamsBuilder(org.hisp.dhis.helpers.QueryParamsBuilder) JsonObject(com.google.gson.JsonObject) Test(org.junit.jupiter.api.Test) TrackerNtiApiTest(org.hisp.dhis.tracker.TrackerNtiApiTest)

Example 9 with ProgramActions

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

the class EventValidationTests method beforeAll.

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

Example 10 with ProgramActions

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

the class EnrollmentAttributeTests method beforeEach.

@BeforeEach
public void beforeEach() {
    teaAttributeActions = new TrackedEntityAttributeActions();
    programActions = new ProgramActions();
    loginActions.loginAsAdmin();
    programId = programActions.createTrackerProgram(Constants.TRACKED_ENTITY_TYPE, Constants.ORG_UNIT_IDS).extractUid();
    setupAttributes();
}
Also used : ProgramActions(org.hisp.dhis.actions.metadata.ProgramActions) TrackedEntityAttributeActions(org.hisp.dhis.actions.metadata.TrackedEntityAttributeActions) 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