use of net.geoprism.registry.service.SynchronizationConfigService in project geoprism-registry by terraframe.
the class FhirImportTest method setUp.
@Before
public void setUp() {
testData.setUpInstanceData();
syncService = new SynchronizationConfigService();
testData.logIn(USATestData.USER_NPS_RA);
}
use of net.geoprism.registry.service.SynchronizationConfigService in project geoprism-registry by terraframe.
the class DHIS2ServiceTest method testApplySyncConfig.
@Request
@Test
public void testApplySyncConfig() throws Exception {
SynchronizationConfig config = createSyncConfig(this.system, null, false);
SynchronizationConfigService service = new SynchronizationConfigService();
JsonObject json = config.toJSON();
json.remove("oid");
JsonObject configToJson = service.apply(testData.clientSession.getSessionId(), json.toString());
String oid = configToJson.get(SynchronizationConfig.OID).getAsString();
SynchronizationConfig.get(oid);
}
use of net.geoprism.registry.service.SynchronizationConfigService in project geoprism-registry by terraframe.
the class DHIS2ServiceTest method testExportGeoObjects.
@Request
@Test
public void testExportGeoObjects() throws InterruptedException {
SynchronizationConfig config = createSyncConfig(this.system, null);
SynchronizationConfigService service = new SynchronizationConfigService();
JsonObject joHist = service.run(testData.clientSession.getSessionId(), config.getOid());
ExportHistory hist = ExportHistory.get(joHist.get("historyId").getAsString());
SchedulerTestUtils.waitUntilStatus(hist.getOid(), AllJobStatus.SUCCESS);
hist = ExportHistory.get(hist.getOid());
Assert.assertEquals(new Long(1), hist.getWorkTotal());
Assert.assertEquals(new Long(1), hist.getWorkProgress());
Assert.assertEquals(ImportStage.COMPLETE.name(), hist.getStage().get(0).name());
LinkedList<Dhis2Payload> payloads = this.dhis2.getPayloads();
Assert.assertEquals(1, payloads.size());
Dhis2Payload payload = payloads.get(0);
JsonObject data = JsonParser.parseString(payload.getData()).getAsJsonObject();
JsonArray orgUnits = data.get("organisationUnits").getAsJsonArray();
Assert.assertEquals(1, orgUnits.size());
JsonObject orgUnit = orgUnits.get(0).getAsJsonObject();
Assert.assertEquals("AllAttrGO_ALL", orgUnit.get("code").getAsString());
}
Aggregations