use of org.hisp.dhis.actions.UserActions in project dhis2-core by dhis2.
the class UserDisableTest method beforeEach.
@BeforeEach
public void beforeEach() {
userActions = new UserActions();
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 TrackedEntityInstanceAclReadTests method before.
@BeforeAll
public void before() throws Exception {
teiActions = new TEIActions();
metadataActions = new MetadataActions();
userActions = new UserActions();
// Setup as SuperUser
new LoginActions().loginAsDefaultUser();
// Set up metadata (Import twice to connect all references)
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/acl/metadata.json"));
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/acl/metadata.json"));
// Import test data
teiActions.postFile(new File("src/test/resources/tracker/acl/data.json"));
// Set up all users for testing
users.add(new User("User A", "O2PajOxjJSa", "UserA!123"));
users.add(new User("User B", "aDy67f9ijOe", "UserB!123"));
users.add(new User("User C", "CKrrGm5Be8O", "UserC!123"));
users.add(new User("User D", "Lpa5INiC3Qf", "UserD!123"));
users.add(new User("User ALL", "GTqb3WOZMop", "UserALL!123"));
// Update passwords, so we can log in as them
// Set AllAuth if user has it and ou scopes.
// Map metadata and data sharing
users.forEach(this::setupUser);
}
use of org.hisp.dhis.actions.UserActions 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.UserActions in project dhis2-core by dhis2.
the class MetadataExportTests method beforeAll.
@BeforeAll
public void beforeAll() {
metadataActions = new MetadataActions();
loginActions = new LoginActions();
userActions = new UserActions();
userActions.addUser(userWithoutAccessUsername, userWithoutAccessPassword);
}
use of org.hisp.dhis.actions.UserActions 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();
}
Aggregations