use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class JobConfigurationControllerTest method testDATA_INTEGRITY.
@Test
void testDATA_INTEGRITY() {
String jobId = assertStatus(HttpStatus.CREATED, POST("/jobConfigurations", "{'name':'test','jobType':'DATA_INTEGRITY','cronExpression':'0 0 12 ? * MON-FRI'}"));
JsonObject parameters = assertJobConfigurationExists(jobId, "DATA_INTEGRITY");
assertTrue(parameters.exists());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class JobConfigurationControllerTest method testPROGRAM_NOTIFICATIONS.
@Test
void testPROGRAM_NOTIFICATIONS() {
String jobId = assertStatus(HttpStatus.CREATED, POST("/jobConfigurations", "{'name':'test','jobType':'PROGRAM_NOTIFICATIONS','cronExpression':'0 0 1 ? * *'}"));
JsonObject parameters = assertJobConfigurationExists(jobId, "PROGRAM_NOTIFICATIONS");
assertFalse(parameters.exists());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class FileResourceControllerTest method testSaveOrgUnitImage.
@Test
void testSaveOrgUnitImage() {
MockMultipartFile image = new MockMultipartFile("file", "OU_profile_image.png", "image/png", "<<png data>>".getBytes());
HttpResponse response = POST_MULTIPART("/fileResources?domain=ORG_UNIT", image);
JsonObject savedObject = response.content(HttpStatus.ACCEPTED).getObject("response").getObject("fileResource");
assertEquals("OU_profile_image.png", savedObject.getString("name").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistDescribeControllerTest method testDescribe_Error_PlanningFailed.
@Test
void testDescribe_Error_PlanningFailed() {
JsonObject description = GET("/users/{uid}/userGroups/gist?describe=true&filter=foo:eq:bar", getSuperuserUid()).content();
assertTrue(description.has("error", "unplanned", "status"));
assertTrue(description.getObject("error").has("type", "message"));
assertTrue(description.getObject("unplanned").has("fields", "filters", "orders"));
assertEquals("planning-failed", description.getString("status").string());
}
use of org.hisp.dhis.jsontree.JsonObject in project dhis2-core by dhis2.
the class GistFilterControllerTest method testFilter_In.
@Test
void testFilter_In() {
createDataSetsForOrganisationUnit(10, orgUnitId, "plus");
String url = "/organisationUnits/{id}/dataSets/gist?filter=name:in:[plus3,plus5]&fields=name&order=name";
JsonObject gist = GET(url, orgUnitId).content();
assertEquals(asList("plus3", "plus5"), gist.getArray("dataSets").stringValues());
}
Aggregations