use of org.hisp.dhis.actions.RestApiActions 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"));
}
use of org.hisp.dhis.actions.RestApiActions in project dhis2-core by dhis2.
the class UserLookupTests method beforeAll.
@BeforeAll
public void beforeAll() {
lookupActions = new RestApiActions("/userLookup");
userActions = new UserActions();
new LoginActions().loginAsSuperUser();
}
use of org.hisp.dhis.actions.RestApiActions in project dhis2-core by dhis2.
the class UserTest method beforeEach.
@BeforeEach
public void beforeEach() {
userActions = new UserActions();
loginActions = new LoginActions();
meActions = new RestApiActions("/me");
username = ("user_tests_" + DataGenerator.randomString()).toLowerCase();
loginActions.loginAsSuperUser();
userActions.addUser(username, password);
loginActions.loginAsUser(username, password);
}
use of org.hisp.dhis.actions.RestApiActions 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);
}
use of org.hisp.dhis.actions.RestApiActions 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();
}
Aggregations