3 * * ============LICENSE_START=======================================================
5 * * ================================================================================
6 * * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
7 * * Copyright (c) 2020 Nokia. All rights reserved.
8 * * ================================================================================
9 * * Licensed under the Apache License, Version 2.0 (the "License");
10 * * you may not use this file except in compliance with the License.
11 * * You may obtain a copy of the License at
13 * * http://www.apache.org/licenses/LICENSE-2.0
15 * * Unless required by applicable law or agreed to in writing, software
16 * * distributed under the License is distributed on an "AS IS" BASIS,
17 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * * See the License for the specific language governing permissions and
19 * * limitations under the License.
20 * * ============LICENSE_END=========================================================
25 package org.onap.blueprintgenerator.test;
27 import com.fasterxml.jackson.databind.ObjectMapper;
28 import org.junit.Ignore;
29 import org.junit.runner.RunWith;
30 import org.onap.blueprintgenerator.BlueprintGeneratorConfiguration;
31 import org.onap.blueprintgenerator.model.componentspec.OnapComponentSpec;
32 import org.onap.blueprintgenerator.service.BlueprintCreatorService;
33 import org.onap.blueprintgenerator.service.base.BlueprintService;
34 import org.onap.blueprintgenerator.service.common.ComponentSpecService;
35 import org.onap.blueprintgenerator.service.dmaap.DmaapBlueprintCreatorService;
36 import org.onap.blueprintgenerator.service.onap.OnapBlueprintCreatorService;
37 import org.onap.policycreate.service.PolicyModelService;
38 import org.springframework.beans.factory.annotation.Autowired;
39 import org.springframework.beans.factory.annotation.Qualifier;
40 import org.springframework.beans.factory.annotation.Value;
41 import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
42 import org.springframework.test.context.ContextConfiguration;
43 import org.springframework.test.context.TestPropertySource;
44 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
47 * @author : Ravi Mantena
49 * Application: ONAP - Blueprint Generator ONAP Test Cases
51 @RunWith(SpringJUnit4ClassRunner.class)
52 @ContextConfiguration(
53 classes = BlueprintGeneratorConfiguration.class,
54 initializers = ConfigFileApplicationContextInitializer.class)
58 "testImports=testImports.yaml",
59 "useTlsTrueAndUseExternalTlsTrueTest=testComponentSpec_withTlsTrueAndExternalTlsTrue.json",
60 "useTlsFalseAndUseExternalTlsFalseTest=testComponentSpec_withTlsFalseAndExternalTlsFalse.json",
61 "useTlsTrueAndNoExternalTlsFlagTest=testComponentSpec_withTlsTrueAndNoExternalTls.json",
62 "noTlsInfo=testComponentSpec_withoutTlsInfo.json"
65 public class BlueprintGeneratorTests {
67 @Qualifier("objectMapper")
69 protected ObjectMapper objectMapper;
71 @Qualifier("yamlObjectMapper")
73 protected ObjectMapper yamlObjectMapper;
78 @Value("${testImports}")
79 protected String testImports;
81 @Value("${useTlsTrueAndUseExternalTlsTrueTest}")
82 protected String useTlsTrueAndUseExternalTlsTrueTest;
84 @Value("${useTlsFalseAndUseExternalTlsFalseTest}")
85 protected String useTlsFalseAndUseExternalTlsFalseTest;
87 @Value("${useTlsTrueAndNoExternalTlsFlagTest}")
88 protected String useTlsTrueAndNoExternalTlsFlagTest;
90 @Value("${noTlsInfo}")
91 protected String noTlsInfo;
94 protected ComponentSpecService onapComponentSpecService;
97 protected DmaapBlueprintCreatorService dmaapBlueprintCreatorService;
100 protected OnapBlueprintCreatorService onapBlueprintCreatorService;
103 protected BlueprintCreatorService blueprintCreatorService;
106 protected BlueprintService blueprintService;
109 protected PolicyModelService policyModelService;
112 protected OnapTestUtils onapTestUtils;
114 protected OnapComponentSpec onapComponentSpec = null;