2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 //package org.onap.aai.sparky.dal;
24 //import static org.junit.Assert.assertNotNull;
25 //import static org.junit.Assert.assertNull;
27 //import org.junit.Before;
28 //import org.junit.Test;
29 //import org.onap.aai.nodes.NodeIngestor;
30 //import org.onap.aai.restclient.enums.RestAuthenticationMode;
31 //import org.onap.aai.setup.Version;
32 //import org.onap.aai.sparky.config.oxm.OxmModelLoader;
33 //import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
34 //import org.springframework.test.context.ContextConfiguration;
38 //@ContextConfiguration(locations = { "classpath:oxm-reader/test-service-beans.xml" })
39 //public class GizmoAdapterTest {
41 // private OxmModelLoader oxmModelLoader;
42 // private RestEndpointConfig endpointConfig;
43 // private GizmoAdapter gizmoAdapter;
45 // private Version version;
48 // public void init() throws Exception {
52 // version = Version.V11;
53 // oxmModelLoader = new OxmModelLoader(version,null,null);
54 // endpointConfig = new RestEndpointConfig();
55 // endpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC);
56 // endpointConfig.setEndpointIpAddress("10.147.110.199");
57 // endpointConfig.setEndpointServerPort("9885");
58 // endpointConfig.setBasicAuthUserName("sparky");
59 // endpointConfig.setBasicAuthPassword("sparky");
60 // gizmoAdapter = new GizmoAdapter(oxmModelLoader, endpointConfig);
64 // @SuppressWarnings("static-access")
66 // public void updateValues() throws Exception {
68 // assertNotNull(gizmoAdapter.getMessageHeaders());
69 // assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
70 // gizmoAdapter.setRelationshipsBasePath("/services/inventory/relationships/v10/");
71 // assertNotNull(gizmoAdapter.getRelationshipsBasePath());
72 // gizmoAdapter.setInventoryBasePath("/services/inventory/v10/");
73 // assertNotNull(gizmoAdapter.getInventoryBasePath());
74 // assertNotNull(gizmoAdapter.extractResourcePath("/services/inventory/v10/"));
75 // assertNotNull(gizmoAdapter.getFullInventoryUrl("/services/inventory/v10/"));
76 // assertNotNull(gizmoAdapter.addServerDetailsToUrl("/services/inventory/v10/"));
77 // assertNotNull(gizmoAdapter.getFullRelationshipUrl(
78 // "https://server.proxy:8443/aai/v11/business/customers/customer/customer-4"));
79 // assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
80 // assertNotNull(gizmoAdapter.repairRelationshipSelfLink(
81 // "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
82 // assertNotNull(gizmoAdapter.repairInventorySelfLink(
83 // "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
84 // assertNotNull(gizmoAdapter.queryGizmo("https://server.proxy:8443/aai/v11/business/customers/",
85 // "application/json"));
86 // assertNotNull(gizmoAdapter.queryGizmoWithRetries(
87 // "https://server.proxy:8443/aai/v11/business/customers/", "application/json", 4));
88 // assertNull(gizmoAdapter.getSelfLinksByEntityType("vserver"));
89 // gizmoAdapter.setEndpointConfig(endpointConfig);
90 // assertNotNull(gizmoAdapter.getEndpointConfig());