use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.
the class AnalyticsDimensionsTest method beforeAll.
@BeforeAll
public void beforeAll() {
trackedEntityAttributeActions = new TrackedEntityAttributeActions();
programActions = new ProgramActions();
analyticsEnrollmentsActions = new AnalyticsEnrollmentsActions();
analyticsEventActions = new AnalyticsEventActions();
}
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();
}
use of org.hisp.dhis.actions.metadata.ProgramActions in project dhis2-core by dhis2.
the class OwnershipTests method beforeAll.
@BeforeAll
public void beforeAll() throws Exception {
userActions = new UserActions();
programActions = new ProgramActions();
loginActions.loginAsSuperUser();
username = createUserWithAccessToOu();
protectedProgram = programActions.createProgramWithAccessLevel("PROTECTED", captureOu, searchOu);
openProgram = programActions.createProgramWithAccessLevel("OPEN", captureOu, searchOu);
String protectedProgramStageId = programActions.get(protectedProgram, new QueryParamsBuilder().add("fields=programStages")).validateStatus(200).extractString("programStages.id[0]");
teiInCaptureScope = super.importTeiWithEnrollmentAndEvent(captureOu, protectedProgram, protectedProgramStageId).extractImportedTeis().get(0);
teiInSearchScope = super.importTeiWithEnrollmentAndEvent(searchOu, protectedProgram, protectedProgramStageId).extractImportedTeis().get(0);
enrollment = trackerActions.getTrackedEntity(teiInSearchScope + "?fields=enrollments").validateStatus(200).getBody();
trackerActions.update(String.format("/ownership/transfer?trackedEntityInstance=%s&program=%s&ou=%s", teiInCaptureScope, protectedProgram, searchOu), new JsonObject()).validateStatus(200);
}
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")));
}
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();
}
Aggregations