use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class NotificationMessageHandlerTest method an_event_about_email_updatedeleted_user_triggers_UserEmailAddressChangedNotificationService.
@Test
public void an_event_about_email_updatedeleted_user_triggers_UserEmailAddressChangedNotificationService() {
/* prepare */
UserMessage userMessage = mock(UserMessage.class);
DomainMessage request = mock(DomainMessage.class);
when(request.getMessageId()).thenReturn(MessageID.USER_EMAIL_ADDRESS_CHANGED);
when(request.get(MessageDataKeys.USER_EMAIL_ADDRESS_CHANGE_DATA)).thenReturn(userMessage);
/* execute */
handlerToTest.receiveAsyncMessage(request);
/* test */
verify(mockedUserEmailAddressChangedNotificationService).notify(userMessage);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class NotificationMessageHandlerTest method an_event_about_requested_new_api_token_triggers_newApiTokenRequestedUserNotificationService.
@Test
public void an_event_about_requested_new_api_token_triggers_newApiTokenRequestedUserNotificationService() {
/* prepare */
UserMessage userMessage = mock(UserMessage.class);
DomainMessage request = mock(DomainMessage.class);
when(request.getMessageId()).thenReturn(MessageID.USER_NEW_API_TOKEN_REQUESTED);
when(request.get(MessageDataKeys.USER_ONE_TIME_TOKEN_INFO)).thenReturn(userMessage);
/* execute */
handlerToTest.receiveAsyncMessage(request);
/* test */
verify(mockedNewApiTokenRequestedUserNotificationService).notify(userMessage);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class NotificationMessageHandlerTest method an_event_about_deleted_project_triggers_3_snotification_ervices.
@Test
public void an_event_about_deleted_project_triggers_3_snotification_ervices() {
/* prepare */
ProjectMessage projectMessage = mock(ProjectMessage.class);
DomainMessage request = mock(DomainMessage.class);
when(request.getMessageId()).thenReturn(MessageID.PROJECT_DELETED);
when(request.get(MessageDataKeys.PROJECT_DELETE_DATA)).thenReturn(projectMessage);
when(request.get(MessageDataKeys.ENVIRONMENT_BASE_URL)).thenReturn("base1");
/* execute */
handlerToTest.receiveAsyncMessage(request);
/* test */
verify(mockedInformAdminsThatProjectHasBeenDeletedNotificationService).notify(projectMessage, "base1");
verify(mockedInformOwnerThatProjectHasBeenDeletedNotificationService).notify(projectMessage, "base1");
verify(mockedInformUsersThatProjectHasBeenDeletedNotificationService).notify(projectMessage, "base1");
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class ScanProgressMonitor method sendRequestBatchJobStatusRequestSynchron.
@IsSendingSyncMessage(MessageID.REQUEST_BATCH_JOB_STATUS)
protected BatchJobMessage sendRequestBatchJobStatusRequestSynchron() {
DomainMessage request = new DomainMessage(MessageID.REQUEST_BATCH_JOB_STATUS);
BatchJobMessage statusRequestMessage = new BatchJobMessage();
statusRequestMessage.setBatchJobId(batchJobId);
request.set(MessageDataKeys.BATCH_JOB_STATUS, statusRequestMessage);
/* ask for status */
DomainMessageSynchronousResult response = eventBus.sendSynchron(request);
BatchJobMessage jobStatusRepsonse = response.get(MessageDataKeys.BATCH_JOB_STATUS);
return jobStatusRepsonse;
}
Aggregations