1 package org.onap.ccsdk.sli.adaptors.aai;
3 import static org.junit.Assert.*;
5 import java.io.UnsupportedEncodingException;
6 import java.net.MalformedURLException;
7 import java.net.URISyntaxException;
10 import org.junit.AfterClass;
11 import org.junit.BeforeClass;
12 import org.junit.Test;
13 import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
17 public class NamedQueryRequestTest {
19 private static final Logger LOG = LoggerFactory.getLogger(NamedQueryRequestTest.class);
21 private static NamedQueryRequest request;
24 public static void setUp() throws Exception {
26 request = new NamedQueryRequest();
27 LOG.info("\nEchoRequestTest.setUp\n");
31 public static void tearDown() throws Exception {
33 LOG.info("----------------------- EchoRequestTest.tearDown -----------------------");
37 public void runGetRequestUrlTest() {
38 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
42 url = request.getRequestUrl("GET", null);
44 } catch (UnsupportedEncodingException | MalformedURLException exc) {
45 LOG.error("Failed test", exc);
51 public void runToJSONStringTest() {
52 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
55 String json = request.toJSONString();
57 } catch (Exception exc) {
58 LOG.error("Failed test", exc);
64 public void runGetArgsListTest() {
65 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
68 String[] args = request.getArgsList();
70 } catch (Exception exc) {
71 LOG.error("Failed test", exc);
77 public void runGetModelTest() {
78 LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------");
81 Class<? extends AAIDatum> clazz = request.getModelClass();
83 } catch (Exception exc) {
84 LOG.error("Failed test", exc);