use of org.hisp.dhis.actions.metadata.MetadataActions 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.metadata.MetadataActions in project dhis2-core by dhis2.
the class MetadataImportImportStrategyTests method before.
@BeforeAll
public void before() {
metadataActions = new MetadataActions();
new LoginActions().loginAsAdmin();
}
use of org.hisp.dhis.actions.metadata.MetadataActions in project dhis2-core by dhis2.
the class EventImportDataValueValidationTests method setupData.
private void setupData() throws Exception {
programId = new IdGenerator().generateUniqueId();
programStageId = new IdGenerator().generateUniqueId();
JsonObject jsonObject = new JsonObjectBuilder(new FileReaderUtils().readJsonAndGenerateData(new File("src/test/resources/tracker/eventProgram.json"))).addPropertyByJsonPath("programStages[0].program.id", programId).addPropertyByJsonPath("programs[0].id", programId).addPropertyByJsonPath("programs[0].programStages[0].id", programStageId).addPropertyByJsonPath("programStages[0].id", programStageId).addPropertyByJsonPath("programStages[0].programStageDataElements", null).build();
new MetadataActions().importAndValidateMetadata(jsonObject);
String dataElementId = dataElementActions.get("?fields=id&filter=domainType:eq:TRACKER&filter=valueType:eq:TEXT&pageSize=1").extractString("dataElements.id[0]");
assertNotNull(dataElementId, "Failed to create data elements");
mandatoryDataElementId = dataElementId;
programActions.addDataElement(programStageId, dataElementId, true).validate().statusCode(200);
}
use of org.hisp.dhis.actions.metadata.MetadataActions 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.metadata.MetadataActions 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