Search in sources :

Example 1 with EventActions

use of org.hisp.dhis.actions.tracker.EventActions 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 EventActions

use of org.hisp.dhis.actions.tracker.EventActions in project dhis2-core by dhis2.

the class UserAssignmentTests method beforeAll.

@BeforeAll
public void beforeAll() {
    metadataActions = new MetadataActions();
    programActions = new ProgramActions();
    eventActions = new EventActions();
    loginActions = new LoginActions();
    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) LoginActions(org.hisp.dhis.actions.LoginActions) EventActions(org.hisp.dhis.actions.tracker.EventActions) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with EventActions

use of org.hisp.dhis.actions.tracker.EventActions in project dhis2-core by dhis2.

the class TEIimportTest method before.

@BeforeAll
public void before() throws Exception {
    teiActions = new TEIActions();
    eventActions = new EventActions();
    enrollmentActions = new RestApiActions("/enrollments");
    new LoginActions().loginAsSuperUser();
    object = new FileReaderUtils().read(new File("src/test/resources/tracker/teis/teisWithEventsAndEnrollments.json")).get(JsonObject.class);
    teiActions.post(object).validate().statusCode(200);
}
Also used : RestApiActions(org.hisp.dhis.actions.RestApiActions) FileReaderUtils(org.hisp.dhis.helpers.file.FileReaderUtils) JsonObject(com.google.gson.JsonObject) LoginActions(org.hisp.dhis.actions.LoginActions) TEIActions(org.hisp.dhis.actions.tracker.TEIActions) EventActions(org.hisp.dhis.actions.tracker.EventActions) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 4 with EventActions

use of org.hisp.dhis.actions.tracker.EventActions 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 5 with EventActions

use of org.hisp.dhis.actions.tracker.EventActions in project dhis2-core by dhis2.

the class RelationshipsTest method before.

@BeforeAll
public void before() throws Exception {
    relationshipActions = new RelationshipActions();
    trackedEntityInstanceActions = new RestApiActions("/trackedEntityInstances");
    metadataActions = new MetadataActions();
    eventActions = new EventActions();
    new LoginActions().loginAsSuperUser();
    metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/relationshipTypes.json"));
    JsonObject teiObject = new FileReaderUtils().read(new File("src/test/resources/tracker/teis/teis.json")).replacePropertyValuesWithIds("trackedEntityInstance").get(JsonObject.class);
    teis = trackedEntityInstanceActions.post(teiObject).extractUids();
    JsonObject eventObject = new FileReaderUtils().read(new File("src/test/resources/tracker/events/events.json")).replacePropertyValuesWithIds("event").get(JsonObject.class);
    ApiResponse response = eventActions.post(eventObject).validateStatus(200);
    events = response.extractUids();
}
Also used : RestApiActions(org.hisp.dhis.actions.RestApiActions) FileReaderUtils(org.hisp.dhis.helpers.file.FileReaderUtils) JsonObject(com.google.gson.JsonObject) MetadataActions(org.hisp.dhis.actions.metadata.MetadataActions) LoginActions(org.hisp.dhis.actions.LoginActions) RelationshipActions(org.hisp.dhis.actions.tracker.RelationshipActions) EventActions(org.hisp.dhis.actions.tracker.EventActions) File(java.io.File) ApiResponse(org.hisp.dhis.dto.ApiResponse) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

EventActions (org.hisp.dhis.actions.tracker.EventActions)10 BeforeAll (org.junit.jupiter.api.BeforeAll)10 LoginActions (org.hisp.dhis.actions.LoginActions)9 ProgramActions (org.hisp.dhis.actions.metadata.ProgramActions)6 File (java.io.File)4 MetadataActions (org.hisp.dhis.actions.metadata.MetadataActions)3 JsonObject (com.google.gson.JsonObject)2 RestApiActions (org.hisp.dhis.actions.RestApiActions)2 UserActions (org.hisp.dhis.actions.UserActions)2 FileReaderUtils (org.hisp.dhis.helpers.file.FileReaderUtils)2 Matchers.containsString (org.hamcrest.Matchers.containsString)1 SystemActions (org.hisp.dhis.actions.SystemActions)1 AttributeActions (org.hisp.dhis.actions.metadata.AttributeActions)1 DataElementActions (org.hisp.dhis.actions.metadata.DataElementActions)1 OrgUnitActions (org.hisp.dhis.actions.metadata.OrgUnitActions)1 RelationshipTypeActions (org.hisp.dhis.actions.metadata.RelationshipTypeActions)1 RelationshipActions (org.hisp.dhis.actions.tracker.RelationshipActions)1 TEIActions (org.hisp.dhis.actions.tracker.TEIActions)1 ApiResponse (org.hisp.dhis.dto.ApiResponse)1