2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
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.ccsdk.sli.adaptors.aai;
24 import static org.junit.Assert.assertNotNull;
26 import java.io.UnsupportedEncodingException;
27 import java.net.MalformedURLException;
30 import org.junit.AfterClass;
31 import org.junit.BeforeClass;
32 import org.junit.FixMethodOrder;
33 import org.junit.Test;
34 import org.junit.runners.MethodSorters;
35 import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum;
36 import org.slf4j.Logger;
37 import org.slf4j.LoggerFactory;
39 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
40 public class EchoRequestTest {
42 private static final Logger LOG = LoggerFactory.getLogger(EchoRequestTest.class);
44 protected static AAIRequest request;
47 public static void setUp() throws Exception {
48 request = new EchoRequest();
49 LOG.info("\nEchoRequestTest.setUp\n");
53 public static void tearDown() throws Exception {
55 LOG.info("----------------------- EchoRequestTest.tearDown -----------------------");
59 public void runGetRequestUrlTest() {
60 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
64 url = request.getRequestUrl("GET", null);
66 } catch (UnsupportedEncodingException | MalformedURLException exc) {
67 LOG.error("Failed test", exc);
73 public void runToJSONStringTest() {
74 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
77 String json = request.toJSONString();
79 } catch (Exception exc) {
80 LOG.error("Failed test", exc);
86 public void runGetArgsListTest() {
87 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
90 String[] args = request.getArgsList();
92 } catch (Exception exc) {
93 LOG.error("Failed test", exc);
99 public void runGetModelTest() {
100 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
103 Class<? extends AAIDatum> clazz = request.getModelClass();
104 assertNotNull(clazz);
105 } catch (Exception exc) {
106 LOG.error("Failed test", exc);