2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat;
22 import static org.junit.jupiter.api.Assertions.assertEquals;
23 import org.junit.jupiter.api.Test;
25 import java.util.Arrays;
26 import java.util.HashSet;
27 import java.util.List;
29 public class AnalyzedZipHeatFilesTest {
31 private AnalyzedZipHeatFiles testSubject = new AnalyzedZipHeatFiles();
34 public void testGetFilesNotEligbleForModules() {
35 testSubject.addNestedFile("testfile1");
36 testSubject.addModuleFile("testfile2");
37 HashSet<String> fileNames = new HashSet<>();
38 fileNames.addAll(Arrays.asList("testfile2", "testfile3"));
39 testSubject.addNestedFiles(fileNames);
41 testSubject.addOtherNonModuleFile("testfile4");
42 testSubject.addModuleFile("testfile5");
43 testSubject.addModuleFile("testfile7");
44 HashSet<String> fileNames2 = new HashSet<>();
45 fileNames2.addAll(Arrays.asList("testfile5", "testfile6"));
46 testSubject.addOtherNonModuleFiles(fileNames2);
48 HashSet<String> moduelFiles = (HashSet<String>) testSubject.getModuleFiles();
49 assertEquals(1, moduelFiles.size());
50 assertEquals("testfile7", moduelFiles.iterator().next());
52 List<String> res = (List<String>) testSubject.getFilesNotEligbleForModules();
53 assertEquals(6, res.size());