Search in sources :

Example 6 with CommonProfessionalTypeDTO

use of com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO in project ArachneCentralAPI by OHDSI.

the class ProfessionalTypeControllerTests method testUpdateProfessionalType.

@Test
@DatabaseSetup(value = "/data/professionaltype/professional-type-before-updating.xml")
@ExpectedDatabase(table = "professional_types", value = "/data/professionaltype/professional-type-after-updating.xml", assertionMode = NON_STRICT)
public void testUpdateProfessionalType() throws Exception {
    CommonProfessionalTypeDTO professionalTypeDTO = new CommonProfessionalTypeDTO();
    professionalTypeDTO.setName(UPDATED_PROFESSIONAL_TYPE_NAME);
    professionalTypeDTO.setId(PROFESSIONAL_TYPE_ID);
    MvcResult mvcResult = mvc.perform(put("/api/v1/admin/professional-types/" + PROFESSIONAL_TYPE_ID).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(professionalTypeDTO))).andExpect(jsonPath("$.result.id").isNotEmpty()).andExpect(OK_STATUS).andExpect(NO_ERROR_CODE).andReturn();
    JSONAssert.assertEquals(UPDATED_PROFESSIONAL_TYPE_JSON_OBJECT, getResultJSONObject(mvcResult), false);
}
Also used : CommonProfessionalTypeDTO(com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO) MvcResult(org.springframework.test.web.servlet.MvcResult) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup)

Example 7 with CommonProfessionalTypeDTO

use of com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO in project ArachneCentralAPI by OHDSI.

the class ProfessionalTypeToProfessionalTypeDTOConverter method convert.

@Override
public CommonProfessionalTypeDTO convert(ProfessionalType source) {
    CommonProfessionalTypeDTO professionalTypeDTO = new CommonProfessionalTypeDTO();
    professionalTypeDTO.setId(source.getId());
    professionalTypeDTO.setName(source.getName());
    return professionalTypeDTO;
}
Also used : CommonProfessionalTypeDTO(com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO)

Example 8 with CommonProfessionalTypeDTO

use of com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO in project ArachneCentralAPI by OHDSI.

the class UserControllerTests method getUserProfileGeneralDTO.

private UserProfileGeneralDTO getUserProfileGeneralDTO() {
    UserProfileGeneralDTO inputDTO = new UserProfileGeneralDTO();
    inputDTO.setFirstname(UPDATED_FIRST_NAME);
    inputDTO.setLastname(UPDATED_LAST_NAME);
    inputDTO.setMiddlename(UPDATED_MIDDLE_NAME);
    inputDTO.setAffiliation(UPDATED_AFFILIATION);
    inputDTO.setPersonalSummary(UPDATED_PERSONAL_SUMMARY);
    CommonProfessionalTypeDTO professionalTypeDTO = new CommonProfessionalTypeDTO();
    professionalTypeDTO.setId(PROFESSIONAL_TYPE_ID);
    inputDTO.setProfessionalType(professionalTypeDTO);
    return inputDTO;
}
Also used : UserProfileGeneralDTO(com.odysseusinc.arachne.portal.api.v1.dto.UserProfileGeneralDTO) CommonProfessionalTypeDTO(com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO)

Aggregations

CommonProfessionalTypeDTO (com.odysseusinc.arachne.commons.api.v1.dto.CommonProfessionalTypeDTO)4 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)4 ProfessionalType (com.odysseusinc.arachne.portal.model.ProfessionalType)4 ApiOperation (io.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)2 ExpectedDatabase (com.github.springtestdbunit.annotation.ExpectedDatabase)2 Test (org.junit.Test)2 MvcResult (org.springframework.test.web.servlet.MvcResult)2 FieldError (org.springframework.validation.FieldError)2 UserProfileGeneralDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserProfileGeneralDTO)1