Search in sources :

Example 1 with StudentFlag

use of fi.otavanopisto.muikku.atests.StudentFlag in project muikku by otavanopisto.

the class AbstractUITest method flagStudent.

protected Long flagStudent(Long studentId, Long flagId) throws JsonParseException, JsonMappingException, IOException {
    ObjectMapper objectMapper = new ObjectMapper().registerModule(new JSR310Module()).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
    Response response = asAdmin().contentType("application/json").post("/test/students/{ID}/flags/{FLAGID}", studentId, flagId);
    response.then().statusCode(200);
    StudentFlag result = objectMapper.readValue(response.asString(), StudentFlag.class);
    return result.getId();
}
Also used : Response(com.jayway.restassured.response.Response) JSR310Module(com.fasterxml.jackson.datatype.jsr310.JSR310Module) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) StudentFlag(fi.otavanopisto.muikku.atests.StudentFlag)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 JSR310Module (com.fasterxml.jackson.datatype.jsr310.JSR310Module)1 Response (com.jayway.restassured.response.Response)1 StudentFlag (fi.otavanopisto.muikku.atests.StudentFlag)1