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)
42 properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties"})
43 @ContextConfiguration(classes = {MockProvider.class, SchemaVersionsBean.class})
45 public class SchemaVersionsBeanTest {
47 // set thrown.expect to whatever a specific test needs
48 // this establishes a default of expecting no exceptions to be thrown
50 public ExpectedException thrown = ExpectedException.none();
52 SchemaVersionsBean SchemaVersionsBean;
55 public void testGetContextForVersion() throws IOException {
57 SchemaVersions versions = SchemaVersionsBean.getSchemaVersions();
58 assertEquals(versions.getDefaultVersion(), new SchemaVersion("v15"));
62 public void testGetVersions() throws IOException {
64 List<SchemaVersion> versions = SchemaVersionsBean.getVersions();
65 assertNotNull(versions);
69 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("v15"));
76 * assertEquals(versions.getAppRootVersion(), new SchemaVersion("v11"));
77 * assertEquals(versions.getDepthVersion(), new SchemaVersion("v10"));
78 * assertEquals(versions.getEdgeLabelVersion(), new SchemaVersion("v12"));
79 * assertEquals(versions.getNamespaceChangeVersion(), new SchemaVersion("v11"));
80 * assertEquals(versions.getRelatedLinkVersion(), new SchemaVersion("v10"));
83 assertEquals(versions.getAppRootVersion(), new SchemaVersion("v15"));
84 assertEquals(versions.getDepthVersion(), new SchemaVersion("v15"));
85 assertEquals(versions.getEdgeLabelVersion(), new SchemaVersion("v15"));
86 assertEquals(versions.getNamespaceChangeVersion(), new SchemaVersion("v15"));
87 assertEquals(versions.getRelatedLinkVersion(), new SchemaVersion("v15"));