2 * # ============LICENSE_START=======================================================
3 * # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved.
4 * # ================================================================================
5 * # Licensed under the Apache License, Version 2.0 (the "License");
6 * # you may not use this file except in compliance with the License.
7 * # You may obtain a copy of the License at
9 * # http://www.apache.org/licenses/LICENSE-2.0
11 * # Unless required by applicable law or agreed to in writing, software
12 * # distributed under the License is distributed on an "AS IS" BASIS,
13 * # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * # See the License for the specific language governing permissions and
15 * # limitations under the License.
16 * # ============LICENSE_END=========================================================
20 package org.onap.dcaegen2.platform.helmchartgenerator;
22 import org.junit.jupiter.api.Test;
23 import org.junit.jupiter.api.extension.ExtendWith;
24 import org.mockito.Mock;
25 import org.mockito.Mockito;
26 import org.mockito.junit.jupiter.MockitoExtension;
27 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.ChartGenerator;
28 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.HelmClient;
29 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.KeyValueMerger;
30 import org.onap.dcaegen2.platform.helmchartgenerator.models.chartinfo.ChartInfo;
32 import static org.mockito.ArgumentMatchers.any;
34 @ExtendWith(MockitoExtension.class)
35 class ChartGeneratorTest {
38 private KeyValueMerger kvMerger;
41 private HelmClient helmClient;
47 void testChartGenerationSteps() throws Exception{
48 ChartGenerator chartGenerator = new ChartGenerator(helmClient, kvMerger, utils);
49 Mockito.when(utils.cloneFileToTempLocation(any())).thenReturn(any());
51 chartGenerator.generate("src/test/input/blueprint", new ChartInfo(), "src/test/output");
53 Mockito.verify(kvMerger, Mockito.times(1)).mergeValuesToChart(any(), any());
54 Mockito.verify(helmClient, Mockito.times(1)).lint(any());
55 Mockito.verify(helmClient, Mockito.times(1)).packageChart(any(), any());