use of org.hisp.dhis.dto.ApiResponse in project dhis2-core by dhis2.
the class DataImportTest method cleanUp.
@AfterAll
public void cleanUp() {
QueryParamsBuilder queryParamsBuilder = new QueryParamsBuilder();
queryParamsBuilder.addAll("importReportMode=FULL", "importStrategy=DELETE");
ApiResponse response = dataValueSetActions.postFile(new File("src/test/resources/aggregate/dataValues_bulk.json"), queryParamsBuilder);
response.validate().statusCode(200);
response = dataValueSetActions.postFile(new File("src/test/resources/aggregate/dataValues_single_dataset.json"), queryParamsBuilder);
response.validate().statusCode(200);
}
use of org.hisp.dhis.dto.ApiResponse in project dhis2-core by dhis2.
the class ProgramActions method createEventProgram.
public ApiResponse createEventProgram(String... orgUnitsIds) {
JsonObject body = new JsonObjectBuilder(buildProgram("WITHOUT_REGISTRATION", null, orgUnitsIds)).build();
ApiResponse response = post(body);
createProgramStage(response.extractUid(), "DEFAULT STAGE");
return response;
}
use of org.hisp.dhis.dto.ApiResponse in project dhis2-core by dhis2.
the class ProgramActions method createProgramStage.
/**
* Creates a program stage and links it to the program.
*
* @param programId
* @param programStageName
* @return program stage id
*/
public String createProgramStage(String programId, String programStageName) {
ApiResponse response = programStageActions.post(new JsonObjectBuilder().addProperty("name", programStageName).addObject("program", new JsonObjectBuilder().addProperty("id", programId)).addProperty("publicAccess", "rwrw----").build());
response.validate().statusCode(Matchers.is(Matchers.oneOf(201, 200)));
return response.extractUid();
}
use of org.hisp.dhis.dto.ApiResponse in project dhis2-core by dhis2.
the class EventActions method delete.
/**
* Hard deletes event.
*
* @param eventId
* @return
*/
@Override
public ApiResponse delete(String eventId) {
ApiResponse response = super.delete(eventId);
new MaintenanceActions().removeSoftDeletedEvents();
return response;
}
use of org.hisp.dhis.dto.ApiResponse in project dhis2-core by dhis2.
the class OrgUnitActions method create.
public String create(final OrgUnit orgUnit) {
ApiResponse response = post(orgUnit);
response.validate().statusCode(201);
return response.extractString("response.uid");
}
Aggregations