use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class MetadataImportExportControllerTest method testPostJsonMetadata_Pre38.
@Test
void testPostJsonMetadata_Pre38() {
JsonObject report = POST("/37/metadata", "{'organisationUnits':[{'name':'My Unit', 'shortName':'OU1', 'openingDate': '2020-01-01'}]}").content(HttpStatus.OK);
assertEquals("OK", report.getString("status").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class MetadataImportExportControllerTest method testPostCsvMetadata_Pre38.
@Test
void testPostCsvMetadata_Pre38() {
JsonObject report = POST("/37/metadata?classKey=ORGANISATION_UNIT", Body(","), ContentType("application/csv")).content(HttpStatus.OK);
assertEquals("OK", report.getString("status").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class SystemSettingControllerTest method testGetSystemSettingsJson.
@Test
void testGetSystemSettingsJson() {
assertStatus(HttpStatus.OK, POST("/systemSettings/keyUiLocale?value=de"));
JsonObject setting = GET("/systemSettings?key=keyUiLocale").content(HttpStatus.OK);
assertTrue(setting.isObject());
assertEquals(1, setting.size());
assertEquals("de", setting.getString("keyUiLocale").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class MeControllerTest method testGetSettings.
@Test
void testGetSettings() {
JsonObject settings = GET("/me/settings").content(HttpStatus.OK);
assertTrue(settings.isObject());
assertFalse(settings.isEmpty());
assertTrue(settings.get("keyMessageSmsNotification").exists());
assertEquals("en", settings.getString("keyUiLocale").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class MeControllerTest method testGetDashboard.
@Test
void testGetDashboard() {
JsonObject dashboard = GET("/me/dashboard").content();
assertEquals(0, dashboard.getNumber("unreadInterpretations").intValue());
assertEquals(0, dashboard.getNumber("unreadMessageConversations").intValue());
}
Aggregations