use of org.hisp.dhis.webapi.json.domain.JsonImportSummary in project dhis2-core by dhis2.
the class MetadataImportExportControllerTest method testPostProgramStageWithoutProgram.
@Test
void testPostProgramStageWithoutProgram() {
JsonWebMessage message = POST("/metadata/", "{'programStages':[{'name':'test programStage'}]}").content(HttpStatus.CONFLICT).as(JsonWebMessage.class);
JsonImportSummary response = message.get("response", JsonImportSummary.class);
assertEquals(1, response.getTypeReports().get(0).getObjectReports().get(0).getErrorReports().size());
assertEquals(ErrorCode.E4053, response.getTypeReports().get(0).getObjectReports().get(0).getErrorReports().get(0).getErrorCode());
}
use of org.hisp.dhis.webapi.json.domain.JsonImportSummary in project dhis2-core by dhis2.
the class DataValueSetControllerTest method testPostJsonDataValueSet_Pre38.
@Test
void testPostJsonDataValueSet_Pre38() {
JsonImportSummary summary = POST("/37/dataValueSets/", "{}").content(HttpStatus.OK).as(JsonImportSummary.class);
assertEquals("ImportSummary", summary.getResponseType());
assertEquals("SUCCESS", summary.getStatus());
}
use of org.hisp.dhis.webapi.json.domain.JsonImportSummary in project dhis2-core by dhis2.
the class DataValueSetControllerTest method testPostCsvDataValueSet_Pre38.
@Test
void testPostCsvDataValueSet_Pre38() {
JsonImportSummary summary = POST("/37/dataValueSets/", Body("abc"), ContentType("application/csv")).content(HttpStatus.OK).as(JsonImportSummary.class);
assertEquals("ImportSummary", summary.getResponseType());
assertEquals("SUCCESS", summary.getStatus());
}
use of org.hisp.dhis.webapi.json.domain.JsonImportSummary in project dhis2-core by dhis2.
the class CompleteDataSetRegistrationControllerTest method testPostCompleteRegistrationsJson_Pre38.
@Test
void testPostCompleteRegistrationsJson_Pre38() {
JsonImportSummary summary = POST("/37/completeDataSetRegistrations", "{}").content(HttpStatus.OK).as(JsonImportSummary.class);
assertEquals("ImportSummary", summary.getResponseType());
assertEquals("ERROR", summary.getStatus());
}
use of org.hisp.dhis.webapi.json.domain.JsonImportSummary in project dhis2-core by dhis2.
the class UserControllerTest method testPutJsonObject_Pre38.
@Test
void testPutJsonObject_Pre38() {
JsonObject user = GET("/users/{uid}", peter.getUid()).content();
JsonImportSummary summary = PUT("/37/users/" + peter.getUid(), user.toString()).content(HttpStatus.OK).as(JsonImportSummary.class);
assertEquals("ImportReport", summary.getResponseType());
assertEquals("OK", summary.getStatus());
assertEquals(1, summary.getStats().getUpdated());
assertEquals(peter.getUid(), summary.getTypeReports().get(0).getObjectReports().get(0).getUid());
}
Aggregations