use of fi.otavanopisto.muikku.atests.Announcement in project muikku by otavanopisto.
the class AbstractUITest method createAnnouncement.
protected Long createAnnouncement(Long publisherUserEntityId, String caption, String content, Date startDate, Date endDate, Boolean archived, Boolean publiclyVisible, List<Long> userGroupIds) throws Exception {
ObjectMapper objectMapper = new ObjectMapper().registerModule(new JSR310Module()).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
Announcement payload = new Announcement(null, publisherUserEntityId, userGroupIds, caption, content, new Date(), startDate, endDate, archived, publiclyVisible);
Response response = asAdmin().contentType("application/json").body(payload).post("/test/announcements");
response.then().statusCode(200);
Long result = objectMapper.readValue(response.asString(), Long.class);
return result;
}
Aggregations