1 /** # ============LICENSE_START=======================================================
2 * # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved.
3 * # ================================================================================
4 * # Licensed under the Apache License, Version 2.0 (the "License");
5 * # you may not use this file except in compliance with the License.
6 * # You may obtain a copy of the License at
8 * # http://www.apache.org/licenses/LICENSE-2.0
10 * # Unless required by applicable law or agreed to in writing, software
11 * # distributed under the License is distributed on an "AS IS" BASIS,
12 * # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * # See the License for the specific language governing permissions and
14 * # limitations under the License.
15 * # ============LICENSE_END=========================================================
19 package org.onap.dcaegen2.platform.helmchartgenerator;
21 import org.junit.jupiter.api.Test;
22 import org.junit.jupiter.api.extension.ExtendWith;
23 import org.mockito.Mock;
24 import org.mockito.Mockito;
25 import org.mockito.junit.jupiter.MockitoExtension;
26 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.ChartBuilder;
27 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.ChartGenerator;
28 import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.ComponentSpecParser;
29 import org.onap.dcaegen2.platform.helmchartgenerator.validation.ChartTemplateStructureValidator;
31 import static org.mockito.ArgumentMatchers.any;
33 @ExtendWith(MockitoExtension.class)
34 class ChartBuilderTest {
37 private ChartGenerator chartGenerator;
40 private ComponentSpecParser specParser;
43 private ChartTemplateStructureValidator validator;
46 void testChartBuilderSteps() throws Exception{
47 ChartBuilder builder = new ChartBuilder(specParser, chartGenerator, validator);
48 builder.build("someSpec", "someChartLocation", "someOutputLocation", "someSpecSchemaLocation");
50 Mockito.verify(specParser, Mockito.times(1)).extractChartInfo(any(), any(), any());
51 Mockito.verify(chartGenerator, Mockito.times(1)).generate(any(), any(), any(), any());
52 Mockito.verify(validator, Mockito.times(1)).validateChartTemplateStructure(any());