use of fi.otavanopisto.muikku.atests.Flag in project muikku by otavanopisto.
the class AbstractUITest method createFlag.
protected Long createFlag(String name, String color, String description) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = new ObjectMapper().registerModule(new JSR310Module()).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
Flag flag = new Flag(null, name, color, description, "STAFF-1/PYRAMUS");
Response response = asAdmin().contentType("application/json").body(flag).post("/test/flags");
response.then().statusCode(200);
Flag result = objectMapper.readValue(response.asString(), Flag.class);
return result.getId();
}
Aggregations