use of com.odysseusinc.arachne.portal.api.v1.dto.dictionary.SkillDTO in project ArachneCentralAPI by OHDSI.
the class UserProfileDTOToUserConverter method convert.
@Override
public User convert(UserProfileDTO dto) {
User user = new User();
HashSet<Skill> skills = new HashSet<>();
if (dto.getSkills() != null) {
for (SkillDTO skillDTO : dto.getSkills()) {
skills.add(conversionService.convert(skillDTO, Skill.class));
}
}
user.setSkills(skills);
return user;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.dictionary.SkillDTO in project ArachneCentralAPI by OHDSI.
the class SkillControllerTests method testUpdateSkill.
@Test
@DatabaseSetup("/data/skill/skill-before-updating.xml")
@ExpectedDatabase(value = "/data/skill/skill-after-updating.xml", assertionMode = NON_STRICT)
public void testUpdateSkill() throws Exception {
SkillDTO skillDTO = new SkillDTO();
skillDTO.setId(SKILL_ID);
skillDTO.setName(UPDATED_SKILL_NAME);
MvcResult mvcResult = mvc.perform(put("/api/v1/admin/skills/" + SKILL_ID).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(skillDTO))).andExpect(jsonPath("$.result.id").isNotEmpty()).andExpect(OK_STATUS).andExpect(NO_ERROR_CODE).andReturn();
JSONAssert.assertEquals(UPDATED_SKILL_JSON_OBJECT, getResultJSONObject(mvcResult), false);
}
Aggregations