@@ -0,0 +1,2574 @@
+/*%0A * Copyright 2021 EPAM Systems%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.epam.ta.reportportal.core.analyzer.auto.impl.preparer;%0A%0Aimport com.epam.ta.reportportal.dao.ClusterRepository;%0Aimport com.epam.ta.reportportal.dao.LaunchRepository;%0Aimport com.epam.ta.reportportal.entity.cluster.Cluster;%0Aimport com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch;%0Aimport com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem;%0Aimport com.epam.ta.reportportal.ws.model.project.AnalyzerConfig;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.util.List;%0A%0Aimport static org.junit.jupiter.api.Assertions.*;%0Aimport static org.mockito.ArgumentMatchers.*;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * @author %3Ca href=%22mailto:ivan_budayeu@epam.com%22%3EIvan Budayeu%3C/a%3E%0A */%0Aclass LaunchPreparerServiceImplTest %7B%0A%0A%09private final LaunchRepository launchRepository = mock(LaunchRepository.class);%0A%09private final ClusterRepository clusterRepository = mock(ClusterRepository.class);%0A%09private final TestItemPreparerService testItemPreparerService = mock(TestItemPreparerService.class);%0A%0A%09private final LaunchPreparerServiceImpl preparerService = new LaunchPreparerServiceImpl(launchRepository,%0A%09%09%09clusterRepository,%0A%09%09%09testItemPreparerService%0A%09);%0A%0A%09@Test%0A%09void prepare() %7B%0A%0A%09%09final long launchId = 1L;%0A%0A%09%09final IndexLaunch indexLaunch = new IndexLaunch();%0A%09%09indexLaunch.setLaunchId(launchId);%0A%09%09indexLaunch.setLaunchName(%22name%22);%0A%09%09indexLaunch.setProjectId(1L);%0A%0A%09%09when(launchRepository.findIndexLaunchByIdsAndLogLevel(eq(List.of(launchId)), anyInt())).thenReturn(List.of(indexLaunch));%0A%0A%09%09final IndexTestItem indexTestItem = new IndexTestItem();%0A%09%09when(testItemPreparerService.prepare(indexLaunch.getLaunchId())).thenReturn(List.of(indexTestItem));%0A%0A%09%09final Cluster cluster = new Cluster();%0A%09%09when(clusterRepository.findAllByLaunchId(indexLaunch.getLaunchId())).thenReturn(List.of(cluster));%0A%0A%09%09final AnalyzerConfig analyzerConfig = new AnalyzerConfig();%0A%09%09preparerService.prepare(List.of(launchId), analyzerConfig);%0A%09%7D%0A%0A%7D

Test added