Search in sources :

Example 1 with URIValidation

use of com.mercedesbenz.sechub.sharedkernel.validation.URIValidation in project sechub by mercedes-benz.

the class ProjectUpdateWhitelistServiceTest method before.

@Before
public void before() throws Exception {
    serviceToTest = new ProjectUpdateWhitelistService();
    repository = mock(ProjectRepository.class);
    eventBus = mock(DomainMessageService.class);
    uriValidation = mock(URIValidation.class);
    serviceToTest.repository = repository;
    serviceToTest.auditLog = mock(AuditLogService.class);
    serviceToTest.assertion = mock(UserInputAssertion.class);
    serviceToTest.eventBus = eventBus;
    serviceToTest.uriValidation = uriValidation;
    serviceToTest.logSanitizer = mock(LogSanitizer.class);
    project = mock(Project.class);
    whitelist = new LinkedHashSet<>();
    whitelist.add(new URI("127.0.0.1"));
    when(project.getWhiteList()).thenReturn(whitelist);
    when(uriValidation.validate(any())).thenReturn(new ValidationResult());
}
Also used : DomainMessageService(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageService) AuditLogService(com.mercedesbenz.sechub.sharedkernel.logging.AuditLogService) LogSanitizer(com.mercedesbenz.sechub.sharedkernel.logging.LogSanitizer) UserInputAssertion(com.mercedesbenz.sechub.sharedkernel.validation.UserInputAssertion) ValidationResult(com.mercedesbenz.sechub.sharedkernel.validation.ValidationResult) URIValidation(com.mercedesbenz.sechub.sharedkernel.validation.URIValidation) URI(java.net.URI) Before(org.junit.Before)

Aggregations

AuditLogService (com.mercedesbenz.sechub.sharedkernel.logging.AuditLogService)1 LogSanitizer (com.mercedesbenz.sechub.sharedkernel.logging.LogSanitizer)1 DomainMessageService (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessageService)1 URIValidation (com.mercedesbenz.sechub.sharedkernel.validation.URIValidation)1 UserInputAssertion (com.mercedesbenz.sechub.sharedkernel.validation.UserInputAssertion)1 ValidationResult (com.mercedesbenz.sechub.sharedkernel.validation.ValidationResult)1 URI (java.net.URI)1 Before (org.junit.Before)1