2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2018-19 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.restclient;
23 import java.util.HashMap;
26 import org.junit.Ignore;
27 import org.junit.Test;
28 import org.junit.runner.RunWith;
29 import org.onap.aai.restclient.*;
30 import org.springframework.beans.factory.annotation.Autowired;
31 import org.springframework.boot.test.context.SpringBootTest;
32 import org.springframework.http.HttpMethod;
33 import org.springframework.http.ResponseEntity;
34 import org.springframework.test.context.ContextConfiguration;
35 import org.springframework.test.context.TestPropertySource;
36 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
39 @RunWith(SpringJUnit4ClassRunner.class)
40 @TestPropertySource(locations = "/schemaService/schema-service-rest.properties")
41 @ContextConfiguration(
42 classes = {RestClientFactoryConfiguration.class, SchemaServiceRestClient.class, RestClientFactory.class,
43 PropertyPasswordConfiguration.class})
46 public class SchemaRestClientTest {
48 private String SCHEMA_SERVICE = "schema-service";
50 private RestClientFactory restClientFactory;
53 public void testGetRequestToSchemaService() {
54 ResponseEntity aaiResponse;
55 RestClient restClient = null;
57 restClient = restClientFactory.getRestClient(SCHEMA_SERVICE);
60 Map<String, String> headersMap = new HashMap<>();
62 aaiResponse = restClient.execute(uri, HttpMethod.GET, headersMap, content);
63 System.out.println("Helo" + aaiResponse.getStatusCode());