use of org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder in project BridgeServer2 by Sage-Bionetworks.
the class AppController method verifySenderEmail.
@PostMapping(path = { "/v1/apps/self/verifyEmail", "/v3/studies/self/verifyEmail" })
public EmailVerificationStatusHolder verifySenderEmail() {
UserSession session = getAuthenticatedSession(DEVELOPER);
App app = appService.getApp(session.getAppId());
EmailVerificationStatus status = emailVerificationService.verifyEmailAddress(app.getSupportEmail());
return new EmailVerificationStatusHolder(status);
}
use of org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder in project BridgeServer2 by Sage-Bionetworks.
the class AppController method getEmailStatus.
@GetMapping(path = { "/v1/apps/self/emailStatus", "/v3/studies/self/emailStatus" })
public EmailVerificationStatusHolder getEmailStatus() {
UserSession session = getAuthenticatedSession(DEVELOPER);
App app = appService.getApp(session.getAppId());
EmailVerificationStatus status = emailVerificationService.getEmailStatus(app.getSupportEmail());
return new EmailVerificationStatusHolder(status);
}
use of org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder in project BridgeServer2 by Sage-Bionetworks.
the class AppControllerTest method getEmailStatus.
@Test
public void getEmailStatus() throws Exception {
doReturn(mockSession).when(controller).getAuthenticatedSession(DEVELOPER);
EmailVerificationStatusHolder result = controller.getEmailStatus();
verify(mockVerificationService).getEmailStatus(EMAIL_ADDRESS);
assertEquals(result.getStatus(), VERIFIED);
}
use of org.sagebionetworks.bridge.models.apps.EmailVerificationStatusHolder in project BridgeServer2 by Sage-Bionetworks.
the class AppControllerTest method verifySenderEmail.
@Test
public void verifySenderEmail() throws Exception {
doReturn(mockSession).when(controller).getAuthenticatedSession(DEVELOPER);
when(mockVerificationService.verifyEmailAddress(EMAIL_ADDRESS)).thenReturn(VERIFIED);
EmailVerificationStatusHolder result = controller.verifySenderEmail();
verify(mockVerificationService).verifyEmailAddress(EMAIL_ADDRESS);
assertEquals(result.getStatus(), VERIFIED);
}
Aggregations