use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage in project sechub by mercedes-benz.
the class AdministrationConfigServiceTest method auto_cleanup_configuration_change_does_result_in_auto_cleanup_change_event_with_correct_data.
@Test
void auto_cleanup_configuration_change_does_result_in_auto_cleanup_change_event_with_correct_data() {
/* prepare */
emulateExistingInitialAdministrationConfig();
long days = 42;
AdministrationAutoCleanupConfig autoCleanupConfiguration = new AdministrationAutoCleanupConfig();
when(calculator.calculateCleanupTimeInDays(eq(autoCleanupConfiguration))).thenReturn(days);
/* execute */
serviceToTest.updateAutoCleanupConfiguration(autoCleanupConfiguration);
/* test */
ArgumentCaptor<DomainMessage> captor = ArgumentCaptor.forClass(DomainMessage.class);
verify(domainMessageService).sendAsynchron(captor.capture());
DomainMessage message = captor.getValue();
AdministrationConfigMessage cleanupData = message.get(MessageDataKeys.AUTO_CLEANUP_CONFIG_CHANGE_DATA);
assertNotNull(cleanupData);
assertEquals(days, cleanupData.getAutoCleanupInDays());
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage in project sechub by mercedes-benz.
the class JobAdministrationMessageHandler method handleAutoCleanUpConfigurationChanged.
@IsReceivingAsyncMessage(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED)
private void handleAutoCleanUpConfigurationChanged(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 ScanMessageHandler 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());
}
Aggregations