90b1ccd0fd467b6cfe5393c2e04b7474ba06436b
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / AAISetupForSwagger.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 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
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20 package org.onap.aai;
21
22
23 import org.junit.BeforeClass;
24
25 import org.junit.ClassRule;
26 import org.junit.Rule;
27 import org.onap.aai.edges.EdgeIngestor;
28 import org.onap.aai.nodes.NodeIngestor;
29 import org.onap.aai.serialization.queryformats.QueryFormatTestHelper;
30 import org.onap.aai.setup.SchemaLocationsBean;
31 import org.onap.aai.util.AAIConstants;
32 import org.onap.aai.testutils.TestUtilConfigTranslatorforEdges;
33 import org.springframework.beans.factory.annotation.Autowired;
34 import org.springframework.test.context.ContextConfiguration;
35 import org.springframework.test.context.TestPropertySource;
36 import org.springframework.test.context.junit4.rules.SpringClassRule;
37 import org.springframework.test.context.junit4.rules.SpringMethodRule;
38
39 @ContextConfiguration(classes = {
40         SchemaLocationsBean.class,
41         TestUtilConfigTranslatorforEdges.class,
42         EdgeIngestor.class,
43         NodeIngestor.class
44 })
45
46 @TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/schemaIngest/schemaIngestTest.properties"})
47 public abstract class AAISetupForSwagger {
48
49     @ClassRule
50     public static final SpringClassRule springClassRule = new SpringClassRule();
51
52     @Rule
53     public final SpringMethodRule springMethodRule = new SpringMethodRule();
54
55    
56         @Autowired
57         protected NodeIngestor nodeIngestor;
58         
59         
60     protected static final String SERVICE_NAME = "JUNIT";
61
62     @BeforeClass
63     public static void setupBundleconfig() throws Exception {
64         System.setProperty("AJSC_HOME", ".");
65         System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local");
66         System.setProperty("aai.service.name", SERVICE_NAME);
67         QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/bundleconfig-local/etc/oxm/");
68     }
69         
70         
71         
72 }