Search in sources :

Example 6 with ContactType

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)));
}
Also used : ContactType(fi.otavanopisto.pyramus.rest.model.ContactType) JSR310Module(com.fasterxml.jackson.datatype.jsr310.JSR310Module) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ContactType (fi.otavanopisto.pyramus.rest.model.ContactType)6 ArrayList (java.util.ArrayList)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 JSR310Module (com.fasterxml.jackson.datatype.jsr310.JSR310Module)2 SchoolDataBridgeInternalException (fi.otavanopisto.muikku.schooldata.SchoolDataBridgeInternalException)2 SchoolDataIdentifier (fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier)2 CourseStaffMember (fi.otavanopisto.pyramus.rest.model.CourseStaffMember)2 CourseStudent (fi.otavanopisto.pyramus.rest.model.CourseStudent)2 Email (fi.otavanopisto.pyramus.rest.model.Email)2 StaffMember (fi.otavanopisto.pyramus.rest.model.StaffMember)2 Student (fi.otavanopisto.pyramus.rest.model.Student)2 StudentGroupStudent (fi.otavanopisto.pyramus.rest.model.StudentGroupStudent)2 RoleSchoolDataIdentifier (fi.otavanopisto.muikku.model.users.RoleSchoolDataIdentifier)1 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)1 UserGroupUserEntity (fi.otavanopisto.muikku.model.users.UserGroupUserEntity)1 UserSchoolDataIdentifier (fi.otavanopisto.muikku.model.users.UserSchoolDataIdentifier)1 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)1 UserAddress (fi.otavanopisto.muikku.schooldata.entity.UserAddress)1 UserEmail (fi.otavanopisto.muikku.schooldata.entity.UserEmail)1 UserPhoneNumber (fi.otavanopisto.muikku.schooldata.entity.UserPhoneNumber)1