Search in sources :

Example 6 with DomainMessageSynchronousResult

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

the class ScanServiceTest method event_handling_FAILED_when_configuration_is_set_but_contains_no_projectId.

@Test
public void event_handling_FAILED_when_configuration_is_set_but_contains_no_projectId() {
    /* prepare */
    SecHubConfiguration configNoProjectId = prepareValidConfiguration();
    configNoProjectId.setProjectId(null);
    DomainMessage request = prepareRequest(configNoProjectId);
    /* execute */
    DomainMessageSynchronousResult result = simulateEventSend(request, serviceToTest);
    /* test */
    assertEquals(MessageID.SCAN_FAILED, result.getMessageId());
}
Also used : DomainMessageSynchronousResult(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult) SecHubConfiguration(com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) Test(org.junit.Test)

Example 7 with DomainMessageSynchronousResult

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

the class ScanServiceTest method scanservice_set_result_traficlight_as_from_report.

@Test
public void scanservice_set_result_traficlight_as_from_report() throws Exception {
    /* execute */
    DomainMessageSynchronousResult result = serviceToTest.receiveSynchronMessage(prepareValidRequest());
    /* test */
    assertEquals(TRAFFIC_LIGHT, result.get(MessageDataKeys.REPORT_TRAFFIC_LIGHT));
}
Also used : DomainMessageSynchronousResult(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult) Test(org.junit.Test)

Example 8 with DomainMessageSynchronousResult

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

the class ScanServiceTest method event_handling_works_as_expected_and_SCAN_DONE_is_returned_as_resulting_message_id.

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

Example 9 with DomainMessageSynchronousResult

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

the class ScanServiceTest method when_no_exception_is_thrown_result_has_not_failed.

@Test
public void when_no_exception_is_thrown_result_has_not_failed() throws Exception {
    /* execute */
    DomainMessageSynchronousResult result = serviceToTest.receiveSynchronMessage(prepareValidRequest());
    /* test */
    assertFalse(result.hasFailed());
}
Also used : DomainMessageSynchronousResult(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult) Test(org.junit.Test)

Example 10 with DomainMessageSynchronousResult

use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult 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)

Aggregations

DomainMessageSynchronousResult (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageSynchronousResult)15 DomainMessage (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage)8 Test (org.junit.Test)8 IsSendingSyncMessageAnswer (com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingSyncMessageAnswer)4 SecHubExecutionException (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException)3 BatchJobMessage (com.mercedesbenz.sechub.sharedkernel.messaging.BatchJobMessage)3 IsSendingSyncMessage (com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingSyncMessage)3 UUID (java.util.UUID)2 JSONConverterException (com.mercedesbenz.sechub.commons.model.JSONConverterException)1 SecHubRuntimeException (com.mercedesbenz.sechub.commons.model.SecHubRuntimeException)1 ScanReport (com.mercedesbenz.sechub.domain.scan.report.ScanReport)1 ScanReportException (com.mercedesbenz.sechub.domain.scan.report.ScanReportException)1 SecHubConfiguration (com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration)1 SecHubExecutionAbandonedException (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionAbandonedException)1 SecHubExecutionContext (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionContext)1 IOException (java.io.IOException)1 BatchStatus (org.springframework.batch.core.BatchStatus)1 JobExecution (org.springframework.batch.core.JobExecution)1