use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistTransformControllerTest method testTransform_Ids.
@Test
void testTransform_Ids() {
JsonObject gist = GET("/dataSets/{id}/organisationUnits/gist?fields=*,dataSets::ids", dataSetId).content();
assertHasPager(gist, 1, 50);
JsonObject orgUnit = gist.getArray("organisationUnits").getObject(0);
assertEquals(dataSetId, orgUnit.getArray("dataSets").getString(0).string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistTransformControllerTest method testTransform_Auto_MediumUsesSize.
@Test
void testTransform_Auto_MediumUsesSize() {
JsonObject gist = GET("/users/{uid}/userGroups/gist?fields=name,users&auto=M", getSuperuserUid()).content();
assertHasPager(gist, 1, 50);
assertEquals(1, gist.getArray("userGroups").getObject(0).getNumber("users").intValue());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistTransformControllerTest method testTransform_Auto_LargeUsesIds.
@Test
void testTransform_Auto_LargeUsesIds() {
JsonObject gist = GET("/users/{uid}/userGroups/gist?fields=name,users&auto=L", getSuperuserUid()).content();
assertHasPager(gist, 1, 50);
assertEquals(getSuperuserUid(), gist.getArray("userGroups").getObject(0).getArray("users").getString(0).string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistTransformControllerTest method testTransform_Rename.
@Test
void testTransform_Rename() {
JsonObject user = GET("/users/{uid}/gist?fields=surname~rename(name),username~rename(alias)", getSuperuserUid()).content();
assertEquals("admin", user.getString("name").string());
assertEquals(2, user.size());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class SystemSettingControllerTest method testGetSystemSettingOrTranslationAsJson.
@Test
void testGetSystemSettingOrTranslationAsJson() {
assertStatus(HttpStatus.OK, POST("/systemSettings/keyUiLocale?value=de"));
JsonObject setting = GET("/systemSettings/keyUiLocale").content(HttpStatus.OK);
assertTrue(setting.isObject());
assertEquals(1, setting.size());
assertEquals("de", setting.getString("keyUiLocale").string());
}
Aggregations