use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class RelationshipsTests method beforeAll.
@BeforeAll
public void beforeAll() throws Exception {
teiActions = new TEIActions();
metadataActions = new MetadataActions();
relationshipTypeActions = new RestApiActions("/relationshipTypes");
loginActions.loginAsSuperUser();
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/relationshipTypes.json"));
teis = importTeis();
events = importEvents();
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class UserAssignmentTests method beforeAll.
@BeforeAll
public void beforeAll() {
programActions = new ProgramActions();
metadataActions = new MetadataActions();
loginActions.loginAsSuperUser();
metadataActions.importAndValidateMetadata(new File("src/test/resources/tracker/eventProgram.json"));
}
use of org.hisp.dhis.actions.metadata.MetadataActions 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);
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class RuleEngineTests method beforeAll.
@BeforeAll
public void beforeAll() {
messageConversationsActions = new MessageConversationsActions();
loginActions.loginAsSuperUser();
new MetadataActions().importAndValidateMetadata(new File("src/test/resources/tracker/programs_with_program_rules.json"));
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class OrgUnitProfileTests method shouldApplyGroupSets.
@Test
public void shouldApplyGroupSets() {
// arrange
MetadataApiResponse response = new MetadataActions().importAndValidateMetadata(new File("src/test/resources/metadata/orgunits/ou_with_group_and_set.json"));
String groupSet = response.extractObjectUid("OrganisationUnitGroupSet").get(0);
String ou = response.extractObjectUid("OrganisationUnit").get(0);
JsonArray array = new JsonArray();
array.add(groupSet);
JsonObject profileBody = new JsonObjectBuilder().addArray("groupSets", array).build();
// act
orgUnitProfileActions.post(profileBody).validate().statusCode(200);
// assert
orgUnitProfileActions.get().validate().body("groupSets", hasSize(greaterThanOrEqualTo(1)));
orgUnitProfileActions.get("/" + ou + "/data").validate().statusCode(200).body("groupSets", hasSize(1)).rootPath("groupSets[0]").body("id", equalTo(groupSet)).body("label", notNullValue()).body("value", notNullValue());
}
Aggregations