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=========================================================
21 package org.onap.aai.setup;
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotNull;
26 import java.io.IOException;
27 import java.util.List;
29 import org.junit.Rule;
30 import org.junit.Test;
31 import org.junit.rules.ExpectedException;
32 import org.junit.runner.RunWith;
33 import org.onap.aai.restclient.MockProvider;
34 import org.springframework.beans.factory.annotation.Autowired;
35 import org.springframework.boot.test.context.SpringBootTest;
36 import org.springframework.test.context.ContextConfiguration;
37 import org.springframework.test.context.TestPropertySource;
38 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
40 @RunWith(SpringJUnit4ClassRunner.class)
43 "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-override-test.properties"})
44 @ContextConfiguration(classes = {MockProvider.class, SchemaVersionsBean.class, SchemaConfigVersions.class})
46 public class SchemaVersionsBeanOverrideTest {
48 // set thrown.expect to whatever a specific test needs
49 // this establishes a default of expecting no exceptions to be thrown
51 public ExpectedException thrown = ExpectedException.none();
53 SchemaVersionsBean SchemaVersionsBean;
56 public void testGetContextForVersion() throws IOException {
58 SchemaVersions versions = SchemaVersionsBean.getSchemaVersions();
59 assertEquals(versions.getDefaultVersion(), new SchemaVersion("v15"));
63 public void testGetVersions() throws IOException {
65 List<SchemaVersion> versions = SchemaVersionsBean.getVersions();
66 assertNotNull(versions);
70 public void testGetters() throws IOException {
71 List<SchemaVersion> versionsList = SchemaVersionsBean.getVersions();
72 assertNotNull(versionsList);
73 SchemaVersions versions = SchemaVersionsBean.getSchemaVersions();
75 assertEquals(versions.getAppRootVersion(), new SchemaVersion("v11"));
76 assertEquals(versions.getDepthVersion(), new SchemaVersion("v10"));
77 assertEquals(versions.getEdgeLabelVersion(), new SchemaVersion("v12"));
78 assertEquals(versions.getNamespaceChangeVersion(), new SchemaVersion("v11"));
79 assertEquals(versions.getRelatedLinkVersion(), new SchemaVersion("v10"));