use of org.sagebionetworks.bridge.models.StatusMessage in project BridgeServer2 by Sage-Bionetworks.
the class HealthDataDocumentationControllerTest method deleteHealthDataDocumentationForIdentifier.
@Test
public void deleteHealthDataDocumentationForIdentifier() {
StatusMessage statusMessage = controller.deleteHealthDataDocumentationForIdentifier(IDENTIFIER);
assertEquals(statusMessage.getMessage(), "Health data documentation has been deleted for the given identifier.");
verify(mockService).deleteHealthDataDocumentation(TEST_APP_ID, IDENTIFIER);
}
use of org.sagebionetworks.bridge.models.StatusMessage in project BridgeServer2 by Sage-Bionetworks.
the class SurveyControllerTest method adminCanLogicallyDelete.
@Test
public void adminCanLogicallyDelete() throws Exception {
setupContext(TEST_APP_ID, UNCONSENTED, ADMIN);
doReturn(session).when(controller).getAuthenticatedSession(DEVELOPER);
Survey survey = getSurvey(false);
when(mockSurveyService.getSurvey(TEST_APP_ID, KEYS, false, false)).thenReturn(survey);
StatusMessage result = controller.deleteSurvey(SURVEY_GUID, CREATED_ON.toString(), false);
assertEquals(result, SurveyController.DELETED_MSG);
verify(mockSurveyService).getSurvey(TEST_APP_ID, KEYS, false, false);
verify(mockSurveyService).deleteSurvey(TEST_APP_ID, survey);
verifyNoMoreInteractions(mockSurveyService);
}
use of org.sagebionetworks.bridge.models.StatusMessage in project BridgeServer2 by Sage-Bionetworks.
the class SurveyControllerTest method physicalDeleteAllowedForAdmin.
@Test
public void physicalDeleteAllowedForAdmin() throws Exception {
setupContext(TEST_APP_ID, UNCONSENTED, ADMIN);
doReturn(session).when(controller).getAuthenticatedSession(DEVELOPER);
Survey survey = getSurvey(false);
when(mockSurveyService.getSurvey(TEST_APP_ID, KEYS, false, false)).thenReturn(survey);
StatusMessage result = controller.deleteSurvey(SURVEY_GUID, CREATED_ON.toString(), true);
assertEquals(result, SurveyController.DELETED_MSG);
verify(mockSurveyService).getSurvey(TEST_APP_ID, KEYS, false, false);
verify(mockSurveyService).deleteSurveyPermanently(TEST_APP_ID, survey);
verifyNoMoreInteractions(mockSurveyService);
}
use of org.sagebionetworks.bridge.models.StatusMessage in project BridgeServer2 by Sage-Bionetworks.
the class SurveyControllerTest method deleteSurveyAllowedForDeveloper.
@Test
public void deleteSurveyAllowedForDeveloper() throws Exception {
setupContext(TEST_APP_ID, UNCONSENTED, DEVELOPER);
doReturn(session).when(controller).getAuthenticatedSession(DEVELOPER);
Survey survey = getSurvey(false);
when(mockSurveyService.getSurvey(TEST_APP_ID, KEYS, false, false)).thenReturn(survey);
StatusMessage result = controller.deleteSurvey(SURVEY_GUID, CREATED_ON.toString(), false);
assertEquals(result, SurveyController.DELETED_MSG);
verify(mockSurveyService).getSurvey(TEST_APP_ID, KEYS, false, false);
verify(mockSurveyService).deleteSurvey(TEST_APP_ID, survey);
verifyNoMoreInteractions(mockSurveyService);
}
use of org.sagebionetworks.bridge.models.StatusMessage in project BridgeServer2 by Sage-Bionetworks.
the class TemplateControllerTest method deleteTemplate.
@Test
public void deleteTemplate() throws Exception {
StatusMessage message = controller.deleteTemplate(GUID, "false");
assertEquals(message.getMessage(), "Template deleted.");
verify(mockTemplateService).deleteTemplate(TEST_APP_ID, GUID);
}
Aggregations