use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class SystemControllerTest method testGetTaskSummaryExtendedJson.
@Test
void testGetTaskSummaryExtendedJson() {
JsonObject summary = GET("/system/taskSummaries/META_DATA_SYNC").content(HttpStatus.OK);
assertTrue(summary.isObject());
assertEquals(0, summary.size());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class TrackedEntityInstanceControllerTest method testUpdateTrackedEntityInstanceJson.
@Test
void testUpdateTrackedEntityInstanceJson() {
String uid = assertStatus(HttpStatus.OK, POST("/trackedEntityInstances", "{'name':'A', 'trackedEntityType':'" + tetId + "', 'orgUnit':'" + ouId + "'}"));
JsonObject tei = GET("/trackedEntityInstances/" + uid).content();
assertWebMessage("OK", 200, "OK", "Import was successful.", PUT("/trackedEntityInstances/" + uid, tei.toString()).content(HttpStatus.OK));
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class TrackerRelationshipsExportControllerTest method getRelationshipsByEnrollment.
@Test
void getRelationshipsByEnrollment() {
TrackedEntityInstance tei = trackedEntityInstance();
ProgramInstance programInstance = programInstance(tei);
RelationshipType rType = relationshipType(RelationshipEntity.PROGRAM_INSTANCE, RelationshipEntity.TRACKED_ENTITY_INSTANCE);
Relationship r = relationship(rType, programInstance, tei);
JsonObject relationship = GET("/tracker/relationships?enrollment=" + programInstance.getUid()).content(HttpStatus.OK);
JsonObject jsonRelationship = assertFirstRelationship(relationship, r);
assertEnrollment(jsonRelationship.getObject("from"), programInstance);
assertTrackedEntity(jsonRelationship.getObject("to"), tei);
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class TrackerRelationshipsExportControllerTest method getRelationshipsByEvent.
@Test
void getRelationshipsByEvent() {
TrackedEntityInstance tei = trackedEntityInstance();
ProgramInstance programInstance = programInstance(tei);
ProgramStageInstance programStageInstance = programStageInstance(programInstance);
RelationshipType rType = relationshipType(RelationshipEntity.PROGRAM_STAGE_INSTANCE, RelationshipEntity.TRACKED_ENTITY_INSTANCE);
Relationship r = relationship(rType, programStageInstance, tei);
JsonObject relationship = GET("/tracker/relationships?event=" + programStageInstance.getUid()).content(HttpStatus.OK);
JsonObject jsonRelationship = assertFirstRelationship(relationship, r);
assertEvent(jsonRelationship.getObject("from"), programStageInstance);
assertTrackedEntity(jsonRelationship.getObject("to"), tei);
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class MetadataImportExportControllerTest method testPostGmlMetadata_Pre38.
@Test
void testPostGmlMetadata_Pre38() {
JsonObject report = POST("/37/metadata/gml", Body("<metadata></metadata>"), ContentType("application/xml")).content(HttpStatus.OK);
assertEquals("OK", report.getString("status").string());
assertEquals("ImportReport", report.getString("responseType").string());
}
Aggregations