use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistValidationControllerTest method testValidation_Access_UserPublicFields.
@Test
void testValidation_Access_UserPublicFields() {
switchToGuestUser();
JsonObject userLookup = GET("/users/{id}/gist?fields=id,code,surname,firstName", getSuperuserUid()).content();
assertTrue(userLookup.has("id", "code", "surname", "firstName"));
assertEquals(getSuperuserUid(), userLookup.getString("id").string());
assertEquals("admin", userLookup.getString("code").string());
assertEquals("admin", userLookup.getString("surname").string());
assertEquals("admin", userLookup.getString("firstName").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class JobConfigurationControllerTest method testANALYTICS_TABLE.
@Test
void testANALYTICS_TABLE() {
String jobId = assertStatus(HttpStatus.CREATED, POST("/jobConfigurations", "{'name':'test','jobType':'ANALYTICS_TABLE','cronExpression':'0 0 3 ? * *'," + "'jobParameters':{'lastYears':'1'," + "'skipTableTypes':['DATA_VALUE','COMPLETENESS','ENROLLMENT']," + "'skipPrograms':['" + UID1 + "','" + UID2 + "']," + "'skipResourceTables':true}}"));
JsonObject parameters = assertJobConfigurationExists(jobId, "ANALYTICS_TABLE");
assertEquals(1, parameters.getNumber("lastYears").intValue());
assertTrue(parameters.getBoolean("skipResourceTables").booleanValue());
assertContainsOnly(parameters.getArray("skipTableTypes").stringValues(), "DATA_VALUE", "COMPLETENESS", "ENROLLMENT");
assertContainsOnly(parameters.getArray("skipPrograms").stringValues(), UID1, UID2);
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class JobConfigurationControllerTest method testRESOURCE_TABLE.
@Test
void testRESOURCE_TABLE() {
String jobId = assertStatus(HttpStatus.CREATED, POST("/jobConfigurations", "{'name':'test','jobType':'RESOURCE_TABLE','cronExpression':'0 0 3 ? * MON'}"));
JsonObject parameters = assertJobConfigurationExists(jobId, "RESOURCE_TABLE");
assertFalse(parameters.exists());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class JobConfigurationControllerTest method testMONITORING.
@Test
void testMONITORING() {
String jobId = assertStatus(HttpStatus.CREATED, POST("/jobConfigurations", "{'name':'test','jobType':'MONITORING','cronExpression':'0 0 12 ? * MON-FRI'," + "'jobParameters':{'relativeStart':'1','relativeEnd':'2','validationRuleGroups':[],'sendNotifications':true,'persistResults':true}}"));
JsonObject parameters = assertJobConfigurationExists(jobId, "MONITORING");
assertEquals(1, parameters.getNumber("relativeStart").intValue());
assertEquals(2, parameters.getNumber("relativeEnd").intValue());
assertTrue(parameters.getBoolean("sendNotifications").booleanValue());
assertTrue(parameters.getBoolean("persistResults").booleanValue());
assertTrue(parameters.getArray("validationRuleGroups").isEmpty());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class SystemControllerTest method testGetTasksJson.
@Test
void testGetTasksJson() {
JsonObject tasks = GET("/system/tasks").content(HttpStatus.OK);
assertObjectMembers(tasks, "CONTINUOUS_ANALYTICS_TABLE", "DATA_SYNC", "TRACKER_PROGRAMS_DATA_SYNC", "EVENT_PROGRAMS_DATA_SYNC", "FILE_RESOURCE_CLEANUP", "IMAGE_PROCESSING", "META_DATA_SYNC", "SMS_SEND", "SEND_SCHEDULED_MESSAGE", "PROGRAM_NOTIFICATIONS", "VALIDATION_RESULTS_NOTIFICATION", "CREDENTIALS_EXPIRY_ALERT", "MONITORING", "PUSH_ANALYSIS", "PREDICTOR", "DATA_STATISTICS", "DATA_INTEGRITY", "RESOURCE_TABLE", "ANALYTICS_TABLE");
}
Aggregations