use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage 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.AdministrationConfigMessage in project sechub by mercedes-benz.
the class AdministrationConfigService method sendEvent.
@IsSendingAsyncMessage(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED)
private void sendEvent(long calculateCleanupTimeInDays) {
AdministrationConfigMessage adminConfigMessage = new AdministrationConfigMessage();
adminConfigMessage.setAutoCleanupInDays(calculateCleanupTimeInDays);
DomainMessage domainMessage = DomainMessageFactory.createEmptyRequest(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED);
domainMessage.set(MessageDataKeys.AUTO_CLEANUP_CONFIG_CHANGE_DATA, adminConfigMessage);
domainMessageService.sendAsynchron(domainMessage);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage in project sechub by mercedes-benz.
the class ScheduleMessageHandlerTest method handler_receiving_auto_cleanup_calls_config_serice_with_message_data.
@Test
void handler_receiving_auto_cleanup_calls_config_serice_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 */
scheduleHandlerToTest.receiveAsyncMessage(message);
/* test */
verify(scheduleHandlerToTest.configService).updateAutoCleanupInDays(days);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage in project sechub by mercedes-benz.
the class ScheduleMessageHandler method ReceivedhandleAutoCleanUpConfigurationChanged.
@IsReceivingAsyncMessage(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED)
private void ReceivedhandleAutoCleanUpConfigurationChanged(DomainMessage request) {
AdministrationConfigMessage message = request.get(MessageDataKeys.AUTO_CLEANUP_CONFIG_CHANGE_DATA);
configService.updateAutoCleanupInDays(message.getAutoCleanupInDays());
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage in project sechub by mercedes-benz.
the class ScanMessageHandlerTest method handler_receiving_auto_cleanup_calls_config_sevice_with_message_data.
@Test
void handler_receiving_auto_cleanup_calls_config_sevice_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 */
messageHandlerToTest.receiveAsyncMessage(message);
/* test */
verify(messageHandlerToTest.configService).updateAutoCleanupInDays(days);
}
Aggregations