use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class JobAdministrationMessageHandlerTest method handler_receiving_auto_cleanup_calls_config_service_with_message_data.
@Test
void handler_receiving_auto_cleanup_calls_config_service_with_message_data() {
/* prepare */
long days = System.nanoTime();
AdministrationConfigMessage configMessage = new AdministrationConfigMessage();
configMessage.setAutoCleanupInDays(days);
DomainMessage message = new DomainMessage(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED);
message.set(MessageDataKeys.AUTO_CLEANUP_CONFIG_CHANGE_DATA, configMessage);
/* execute */
handlerToTest.receiveAsyncMessage(message);
/* test */
verify(configService).updateAutoCleanupInDays(days);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class ProjectAssignUserService method sendUserAddedToProjectEvent.
@IsSendingAsyncMessage(MessageID.USER_ADDED_TO_PROJECT)
private void sendUserAddedToProjectEvent(String projectId, User user) {
DomainMessage request = new DomainMessage(MessageID.USER_ADDED_TO_PROJECT);
UserMessage projectToUserData = new UserMessage();
projectToUserData.setUserId(user.getName());
projectToUserData.setProjectIds(Arrays.asList(projectId));
request.set(MessageDataKeys.PROJECT_TO_USER_DATA, projectToUserData);
eventBus.sendAsynchron(request);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class ProjectChangeAccessLevelService method sendProjectAccessLevelChangedEvent.
@IsSendingAsyncMessage(MessageID.PROJECT_ACCESS_LEVEL_CHANGED)
private void sendProjectAccessLevelChangedEvent(Project project, ProjectAccessLevel formerAccessLevel) {
DomainMessage request = new DomainMessage(MessageID.PROJECT_ACCESS_LEVEL_CHANGED);
ProjectMessage projectData = new ProjectMessage();
projectData.setProjectId(project.id);
projectData.setFormerAccessLevel(formerAccessLevel);
projectData.setNewAccessLevel(project.getAccessLevel());
request.set(MessageDataKeys.PROJECT_ACCESS_LEVEL_CHANGE_DATA, projectData);
eventBus.sendAsynchron(request);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class ProjectChangeOwnerService method sendOwnerChangedForProjectEvent.
@IsSendingAsyncMessage(MessageID.PROJECT_OWNER_CHANGED)
private void sendOwnerChangedForProjectEvent(Project project, User previousOwner, User newOwner) {
DomainMessage request = new DomainMessage(MessageID.PROJECT_OWNER_CHANGED);
ProjectMessage projectData = new ProjectMessage();
projectData.setProjectId(project.id);
projectData.setPreviousProjectOwnerEmailAddress(previousOwner.getEmailAdress());
projectData.setProjectOwnerEmailAddress(newOwner.getEmailAdress());
project.users.forEach(user -> {
projectData.addUserEmailAddress(user.getEmailAdress());
});
request.set(MessageDataKeys.PROJECT_OWNER_CHANGE_DATA, projectData);
eventBus.sendAsynchron(request);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class UserEmailAddressUpdateService method informUserEmailAddressUpdated.
@IsSendingAsyncMessage(MessageID.USER_EMAIL_ADDRESS_CHANGED)
private void informUserEmailAddressUpdated(UserMessage message) {
DomainMessage infoRequest = new DomainMessage(MessageID.USER_EMAIL_ADDRESS_CHANGED);
infoRequest.set(MessageDataKeys.USER_EMAIL_ADDRESS_CHANGE_DATA, message);
eventBusService.sendAsynchron(infoRequest);
}
Aggregations