use of fi.otavanopisto.pyramus.rest.model.ContactType in project muikku by otavanopisto.
the class PyramusMocks method mockContactTypes.
public static void mockContactTypes() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper().registerModule(new JSR310Module()).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
ContactType contactType = new ContactType((long) 1, "Koti", false, false);
ContactType[] contactTypes = { contactType };
String contactTypeJson = objectMapper.writeValueAsString(contactType);
stubFor(get(urlMatching("/1/common/contactTypes/.*")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(contactTypeJson).withStatus(200)));
String contactTypesJson = objectMapper.writeValueAsString(contactTypes);
stubFor(get(urlEqualTo("/1/common/contactTypes")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(contactTypesJson).withStatus(200)));
}
Aggregations