use of org.hisp.dhis.actions.UserActions 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.UserActions in project dhis2-core by dhis2.
the class UsersRemovalTests method beforeEach.
@BeforeEach
public void beforeEach() {
userActions = new UserActions();
optionActions = new OptionActions();
loginActions = new LoginActions();
userName = (DataGenerator.randomString()).toLowerCase();
loginActions.loginAsSuperUser();
userId = userActions.addUser("johnny", "bravo", userName, password);
}
use of org.hisp.dhis.actions.UserActions in project dhis2-core by dhis2.
the class EventIdSchemeTests method setupData.
private void setupData() {
ATTRIBUTE_ID = attributeActions.createUniqueAttribute("TEXT", "organisationUnit", "program");
assertNotNull(ATTRIBUTE_ID, "Failed to setup attribute");
JsonObject orgUnit = JsonObjectBuilder.jsonObject(orgUnitActions.createOrgUnitBody()).addProperty("code", OU_CODE).addProperty("name", OU_NAME).build();
orgUnitId = orgUnitActions.create(orgUnit);
assertNotNull(orgUnitId, "Failed to setup org unit");
new UserActions().grantCurrentUserAccessToOrgUnit(orgUnitId);
programActions.addOrganisationUnits(PROGRAM_ID, orgUnitId).validate().statusCode(200);
orgUnitActions.update(orgUnitId, addAttributeValuePayload(orgUnitActions.get(orgUnitId).getBody(), ATTRIBUTE_ID, ATTRIBUTE_VALUE)).validate().statusCode(200);
programActions.update(PROGRAM_ID, addAttributeValuePayload(programActions.get(PROGRAM_ID).getBody(), ATTRIBUTE_ID, ATTRIBUTE_VALUE)).validate().statusCode(200);
}
use of org.hisp.dhis.actions.UserActions 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);
}
use of org.hisp.dhis.actions.UserActions in project dhis2-core by dhis2.
the class UserAssignmentFilterTests method beforeAll.
@BeforeAll
public void beforeAll() throws Exception {
eventActions = new EventActions();
loginActions = new LoginActions();
metadataActions = new MetadataActions();
userActions = new UserActions();
userUsername = ("EventFiltersUser" + DataGenerator.randomString()).toLowerCase();
loginActions.loginAsSuperUser();
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/eventProgram.json"));
userId = userActions.addUser(userUsername, userPassword);
userActions.grantUserAccessToOrgUnit(userId, orgUnit);
userActions.addUserToUserGroup(userId, Constants.USER_GROUP_ID);
userActions.addRoleToUser(userId, Constants.USER_ROLE_ID);
eventsBody = getEventsBody(programId, "l8oDIfJJhtg", userId);
}
Aggregations