Search in sources :

Example 1 with ArchiveSupportProvider

use of com.mercedesbenz.sechub.sharedkernel.util.ArchiveSupportProvider in project sechub by mercedes-benz.

the class SchedulerSourcecodeUploadServiceTest method beforeEach.

@BeforeEach
void beforeEach() {
    randomUuid = UUID.randomUUID();
    mockedChecksumService = mock(ChecksumSHA256Service.class);
    mockedStorageService = mock(StorageService.class);
    mockedAssertService = mock(ScheduleAssertService.class);
    ScheduleSecHubJob job = new ScheduleSecHubJob();
    when(mockedAssertService.assertJob(PROJECT1, randomUuid)).thenReturn(job);
    storage = mock(JobStorage.class);
    when(mockedStorageService.getJobStorage(PROJECT1, randomUuid)).thenReturn(storage);
    file = mock(MultipartFile.class);
    archiveSupportProvider = mock(ArchiveSupportProvider.class);
    mockedArchiveSupport = mock(ArchiveSupport.class);
    when(archiveSupportProvider.getArchiveSupport()).thenReturn(mockedArchiveSupport);
    configuration = mock(SchedulerSourcecodeUploadConfiguration.class);
    /* attach at service to test */
    serviceToTest = new SchedulerSourcecodeUploadService();
    serviceToTest.checksumSHA256Service = mockedChecksumService;
    serviceToTest.storageService = mockedStorageService;
    serviceToTest.assertService = mockedAssertService;
    serviceToTest.archiveSupportProvider = archiveSupportProvider;
    serviceToTest.configuration = configuration;
    serviceToTest.logSanitizer = mock(LogSanitizer.class);
    serviceToTest.assertion = mock(UserInputAssertion.class);
    serviceToTest.auditLogService = mock(AuditLogService.class);
}
Also used : ChecksumSHA256Service(com.mercedesbenz.sechub.sharedkernel.util.ChecksumSHA256Service) AuditLogService(com.mercedesbenz.sechub.sharedkernel.logging.AuditLogService) ArchiveSupportProvider(com.mercedesbenz.sechub.sharedkernel.util.ArchiveSupportProvider) LogSanitizer(com.mercedesbenz.sechub.sharedkernel.logging.LogSanitizer) StorageService(com.mercedesbenz.sechub.storage.core.StorageService) MultipartFile(org.springframework.web.multipart.MultipartFile) UserInputAssertion(com.mercedesbenz.sechub.sharedkernel.validation.UserInputAssertion) ScheduleSecHubJob(com.mercedesbenz.sechub.domain.schedule.job.ScheduleSecHubJob) JobStorage(com.mercedesbenz.sechub.storage.core.JobStorage) ArchiveSupport(com.mercedesbenz.sechub.commons.archive.ArchiveSupport) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ArchiveSupport (com.mercedesbenz.sechub.commons.archive.ArchiveSupport)1 ScheduleSecHubJob (com.mercedesbenz.sechub.domain.schedule.job.ScheduleSecHubJob)1 AuditLogService (com.mercedesbenz.sechub.sharedkernel.logging.AuditLogService)1 LogSanitizer (com.mercedesbenz.sechub.sharedkernel.logging.LogSanitizer)1 ArchiveSupportProvider (com.mercedesbenz.sechub.sharedkernel.util.ArchiveSupportProvider)1 ChecksumSHA256Service (com.mercedesbenz.sechub.sharedkernel.util.ChecksumSHA256Service)1 UserInputAssertion (com.mercedesbenz.sechub.sharedkernel.validation.UserInputAssertion)1 JobStorage (com.mercedesbenz.sechub.storage.core.JobStorage)1 StorageService (com.mercedesbenz.sechub.storage.core.StorageService)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1