use of com.odysseusinc.arachne.portal.api.v1.dto.UpdateParticipantDTO in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testUpdateContributorRoleToDatasetOwner.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study/study-participant-before-changing-role.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-participant-before-changing-role.xml", assertionMode = NON_STRICT) })
public void testUpdateContributorRoleToDatasetOwner() throws Exception {
UpdateParticipantDTO participantDTO = new UpdateParticipantDTO();
participantDTO.setRole(DATA_SET_OWNER.name());
mvc.perform(put("/api/v1/study-management/studies/" + STUDY_ID + "/participants/" + 2L).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(participantDTO))).andExpect(jsonPath("$.errorCode").value(VALIDATION_ERROR.getCode()));
}
use of com.odysseusinc.arachne.portal.api.v1.dto.UpdateParticipantDTO in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testUpdateContributorRoleToLeadInvestigator.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study/study-participant-before-changing-role.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-participant-with-2-leaders.xml", assertionMode = NON_STRICT) })
public void testUpdateContributorRoleToLeadInvestigator() throws Exception {
UpdateParticipantDTO participantDTO = new UpdateParticipantDTO();
participantDTO.setRole(LEAD_INVESTIGATOR.name());
mvc.perform(put("/api/v1/study-management/studies/" + STUDY_ID + "/participants/" + UserIdUtils.idToUuid(2L)).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(participantDTO))).andExpect(NO_ERROR_CODE).andReturn();
}
use of com.odysseusinc.arachne.portal.api.v1.dto.UpdateParticipantDTO in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testUpdateContributorRoleToContributor.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study/study-participant-with-2-leaders-before-updating.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-participant-with-contributor-and-leader.xml", assertionMode = NON_STRICT) })
public void testUpdateContributorRoleToContributor() throws Exception {
UpdateParticipantDTO participantDTO = new UpdateParticipantDTO();
participantDTO.setRole(CONTRIBUTOR.name());
mvc.perform(put("/api/v1/study-management/studies/" + STUDY_ID + "/participants/" + UserIdUtils.idToUuid(ADMIN_ID)).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(participantDTO))).andExpect(NO_ERROR_CODE).andReturn();
}
use of com.odysseusinc.arachne.portal.api.v1.dto.UpdateParticipantDTO in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testUpdateContributorRoleForLastLeadInvestigator.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study/study-participant-before-changing-role.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-participant-before-changing-role.xml", assertionMode = NON_STRICT) })
public void testUpdateContributorRoleForLastLeadInvestigator() throws Exception {
UpdateParticipantDTO participantDTO = new UpdateParticipantDTO();
participantDTO.setRole(CONTRIBUTOR.name());
mvc.perform(put("/api/v1/study-management/studies/" + STUDY_ID + "/participants/" + UserIdUtils.idToUuid(ADMIN_ID)).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(participantDTO))).andExpect(jsonPath("$.errorCode").value(VALIDATION_ERROR.getCode()));
}
Aggregations