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