3 * * ============LICENSE_START=======================================================
5 * * ================================================================================
6 * * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
7 * * ================================================================================
8 * * Licensed under the Apache License, Version 2.0 (the "License");
9 * * you may not use this file except in compliance with the License.
10 * * You may obtain a copy of the License at
12 * * http://www.apache.org/licenses/LICENSE-2.0
14 * * Unless required by applicable law or agreed to in writing, software
15 * * distributed under the License is distributed on an "AS IS" BASIS,
16 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * * See the License for the specific language governing permissions and
18 * * limitations under the License.
19 * * ============LICENSE_END=========================================================
24 package org.onap.blueprintgenerator.test;
26 import org.onap.blueprintgenerator.BlueprintGeneratorMainApplication;
27 import org.onap.blueprintgenerator.model.componentspec.OnapComponentSpec;
28 import org.onap.blueprintgenerator.service.OnapBlueprintService;
29 import org.onap.blueprintgenerator.service.common.ComponentSpecService;
30 import org.onap.blueprintgenerator.service.dmaap.DmaapBlueprintService;
31 import com.fasterxml.jackson.databind.ObjectMapper;
32 import org.junit.Ignore;
33 import org.junit.runner.RunWith;
34 import org.onap.policycreate.service.PolicyModelService;
35 import org.springframework.beans.factory.annotation.Autowired;
36 import org.springframework.beans.factory.annotation.Qualifier;
37 import org.springframework.beans.factory.annotation.Value;
38 import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
39 import org.springframework.test.context.ContextConfiguration;
40 import org.springframework.test.context.TestPropertySource;
41 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
44 * @author : Ravi Mantena
45 * @date 10/16/2020 Application: ONAP - Blueprint Generator ONAP Test Cases
47 @RunWith(SpringJUnit4ClassRunner.class)
48 @ContextConfiguration(
49 classes = BlueprintGeneratorMainApplication.class,
50 initializers = ConfigFileApplicationContextInitializer.class)
54 "testImports=testImports.yaml",
55 "useTlsTrueAndUseExternalTlsTrueTest=testComponentSpec_withTlsTrueAndExternalTlsTrue.json",
56 "useTlsFalseAndUseExternalTlsFalseTest=testComponentSpec_withTlsFalseAndExternalTlsFalse.json",
57 "useTlsTrueAndNoExternalTlsFlagTest=testComponentSpec_withTlsTrueAndNoExternalTls.json",
58 "noTlsInfo=testComponentSpec_withoutTlsInfo.json"
61 public class BlueprintGeneratorTests {
63 @Qualifier("objectMapper")
65 protected ObjectMapper objectMapper;
67 @Qualifier("yamlObjectMapper")
69 protected ObjectMapper yamlObjectMapper;
74 @Value("${testImports}")
75 protected String testImports;
77 @Value("${useTlsTrueAndUseExternalTlsTrueTest}")
78 protected String useTlsTrueAndUseExternalTlsTrueTest;
80 @Value("${useTlsFalseAndUseExternalTlsFalseTest}")
81 protected String useTlsFalseAndUseExternalTlsFalseTest;
83 @Value("${useTlsTrueAndNoExternalTlsFlagTest}")
84 protected String useTlsTrueAndNoExternalTlsFlagTest;
86 @Value("${noTlsInfo}")
87 protected String noTlsInfo;
90 protected ComponentSpecService onapComponentSpecService;
93 protected DmaapBlueprintService dmaapBlueprintService;
96 protected OnapBlueprintService onapBlueprintService;
99 protected PolicyModelService policyModelService;
102 protected OnapTestUtils onapTestUtils;
104 protected OnapComponentSpec onapComponentSpec = null;