Search in sources :

Example 56 with DomainMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.

the class ScanServiceTest method event_handling_FAILED_when_configuration_is_not_set.

@Test
public void event_handling_FAILED_when_configuration_is_not_set() {
    /* prepare */
    DomainMessage request = prepareValidRequest();
    request.set(MessageDataKeys.SECHUB_CONFIG, null);
    /* execute */
    DomainMessageSynchronousResult result = simulateEventSend(request, serviceToTest);
    /* test */
    assertEquals(MessageID.SCAN_FAILED, result.getMessageId());
}
Also used : DomainMessageSynchronousResult(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) Test(org.junit.Test)

Example 57 with DomainMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.

the class ScanServiceTest method scan_service_fetches_configuration_without_accesscheck.

@Test
public void scan_service_fetches_configuration_without_accesscheck() throws Exception {
    /* prepare */
    SecHubConfiguration configNoProjectId = prepareValidConfiguration();
    DomainMessage request = prepareRequest(configNoProjectId);
    /* execute */
    simulateEventSend(request, serviceToTest);
    /* test */
    verify(scanProjectConfigService).get(TEST_PROJECT_ID1, ScanProjectConfigID.MOCK_CONFIGURATION, false);
}
Also used : SecHubConfiguration(com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) Test(org.junit.Test)

Example 58 with DomainMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.

the class ProjectCreationService method sendProjectCreatedEvent.

@IsSendingAsyncMessage(MessageID.PROJECT_CREATED)
private void sendProjectCreatedEvent(String projectId, Set<URI> whitelist) {
    DomainMessage request = new DomainMessage(MessageID.PROJECT_CREATED);
    ProjectMessage message = new ProjectMessage();
    message.setProjectId(projectId);
    message.setWhitelist(whitelist);
    request.set(MessageDataKeys.PROJECT_CREATION_DATA, message);
    eventBus.sendAsynchron(request);
}
Also used : ProjectMessage(com.mercedesbenz.sechub.sharedkernel.messaging.ProjectMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 59 with DomainMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.

the class ProjectDeleteService method informProjectDeleted.

@IsSendingAsyncMessage(MessageID.PROJECT_DELETED)
private void informProjectDeleted(ProjectMessage message) {
    DomainMessage infoRequest = new DomainMessage(MessageID.PROJECT_DELETED);
    infoRequest.set(MessageDataKeys.PROJECT_DELETE_DATA, message);
    infoRequest.set(MessageDataKeys.ENVIRONMENT_BASE_URL, sechubEnvironment.getServerBaseUrl());
    eventBusService.sendAsynchron(infoRequest);
}
Also used : DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 60 with DomainMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.

the class JobCancelService method informCancelJobRequested.

@IsSendingAsyncMessage(MessageID.REQUEST_JOB_CANCELATION)
private void informCancelJobRequested(JobMessage message) {
    DomainMessage infoRequest = DomainMessageFactory.createEmptyRequest(MessageID.REQUEST_JOB_CANCELATION);
    infoRequest.set(MessageDataKeys.JOB_CANCEL_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Aggregations

DomainMessage (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage)69 IsSendingAsyncMessage (com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)31 UserMessage (com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage)21 Test (org.junit.Test)18 Test (org.junit.jupiter.api.Test)13 ProjectMessage (com.mercedesbenz.sechub.sharedkernel.messaging.ProjectMessage)10 DomainMessageSynchronousResult (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult)8 JobMessage (com.mercedesbenz.sechub.sharedkernel.messaging.JobMessage)6 AdministrationConfigMessage (com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage)5 BatchJobMessage (com.mercedesbenz.sechub.sharedkernel.messaging.BatchJobMessage)4 SecHubConfiguration (com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration)3 IsSendingSyncMessage (com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingSyncMessage)3 UUID (java.util.UUID)3 ScheduleSecHubJob (com.mercedesbenz.sechub.domain.schedule.job.ScheduleSecHubJob)2 SecHubExecutionException (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException)2 SecHubRuntimeException (com.mercedesbenz.sechub.commons.model.SecHubRuntimeException)1 AdministrationAutoCleanupConfig (com.mercedesbenz.sechub.domain.administration.autocleanup.AdministrationAutoCleanupConfig)1 User (com.mercedesbenz.sechub.domain.administration.user.User)1 ScanMockData (com.mercedesbenz.sechub.domain.scan.project.ScanMockData)1 ScanProjectConfig (com.mercedesbenz.sechub.domain.scan.project.ScanProjectConfig)1