use of se.inera.intyg.webcert.web.web.controller.api.dto.QARequest in project webcert by sklintyg.
the class FragaSvarModuleApiControllerIT method closeQAsAsHandled.
@Test
public void closeQAsAsHandled() {
sessionId = getAuthSession(DEFAULT_LAKARE);
String intygId = createSignedIntyg(DEFAULT_INTYGSTYP, DEFAULT_PATIENT_PERSONNUMMER);
int internId = createQuestion(DEFAULT_INTYGSTYP, intygId, DEFAULT_PATIENT_PERSONNUMMER);
// Create the body of the request
ArrayList<QARequest> requests = new ArrayList<>();
QARequest request = new QARequest();
request.setFragaSvarId((long) internId);
request.setIntygsTyp(DEFAULT_INTYGSTYP);
requests.add(request);
given().cookie("ROUTEID", BaseRestIntegrationTest.routeId).contentType(ContentType.JSON).body(requests).expect().statusCode(200).when().put("moduleapi/fragasvar/stang").then().body(matchesJsonSchemaInClasspath("jsonschema/webcert-fragasvar-for-intyg-list-schema.json")).body("$", hasSize(requests.size()));
deleteQuestion(internId);
}
use of se.inera.intyg.webcert.web.web.controller.api.dto.QARequest in project webcert by sklintyg.
the class FragaSvarModuleApiController method closeQAsAsHandled.
@PUT
@Path("/stang")
@Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET)
public List<FragaSvar> closeQAsAsHandled(List<QARequest> qas) {
List<FragaSvar> fragaSvars = new ArrayList<>();
for (QARequest qa : qas) {
abortIfFragaSvarNotActive(qa.getIntygsTyp());
fragaSvars.add(fragaSvarService.closeQuestionAsHandled(qa.getFragaSvarId()));
}
return fragaSvars;
}
Aggregations