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());
}
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);
}
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);
}
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);
}
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);
}
Aggregations