2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
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;
38 @ContextConfiguration(
39 classes = {SchemaLocationsBean.class, TestUtilConfigTranslatorforEdges.class, EdgeIngestor.class,
42 @TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/schemaIngest/schemaIngestTest.properties"})
43 public abstract class AAISetupForSwagger {
46 public static final SpringClassRule springClassRule = new SpringClassRule();
49 public final SpringMethodRule springMethodRule = new SpringMethodRule();
52 protected NodeIngestor nodeIngestor;
54 protected static final String SERVICE_NAME = "JUNIT";
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/");