AAI-1523 Batch reformat aai-core
[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
21 package org.onap.aai;
22
23 import org.junit.BeforeClass;
24 import org.junit.ClassRule;
25 import org.junit.Rule;
26 import org.onap.aai.edges.EdgeIngestor;
27 import org.onap.aai.nodes.NodeIngestor;
28 import org.onap.aai.serialization.queryformats.QueryFormatTestHelper;
29 import org.onap.aai.setup.SchemaLocationsBean;
30 import org.onap.aai.testutils.TestUtilConfigTranslatorforEdges;
31 import org.onap.aai.util.AAIConstants;
32 import org.springframework.beans.factory.annotation.Autowired;
33 import org.springframework.test.context.ContextConfiguration;
34 import org.springframework.test.context.TestPropertySource;
35 import org.springframework.test.context.junit4.rules.SpringClassRule;
36 import org.springframework.test.context.junit4.rules.SpringMethodRule;
37
38 @ContextConfiguration(
39         classes = {SchemaLocationsBean.class, TestUtilConfigTranslatorforEdges.class, EdgeIngestor.class,
40                 NodeIngestor.class})
41
42 @TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/schemaIngest/schemaIngestTest.properties"})
43 public abstract class AAISetupForSwagger {
44
45     @ClassRule
46     public static final SpringClassRule springClassRule = new SpringClassRule();
47
48     @Rule
49     public final SpringMethodRule springMethodRule = new SpringMethodRule();
50
51     @Autowired
52     protected NodeIngestor nodeIngestor;
53
54     protected static final String SERVICE_NAME = "JUNIT";
55
56     @BeforeClass
57     public static void setupBundleconfig() throws Exception {
58         System.setProperty("AJSC_HOME", ".");
59         System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local");
60         System.setProperty("aai.service.name", SERVICE_NAME);
61         QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"),
62                 "src/test/resources/bundleconfig-local/etc/oxm/");
63     }
64
65 }