2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.dmaap.service;
23 import static org.junit.Assert.*;
25 import java.lang.reflect.InvocationTargetException;
26 import java.lang.reflect.Method;
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Test;
32 import org.onap.dmaap.dmf.mr.CambriaApiException;
33 import com.att.nsa.configs.ConfigDbException;
34 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
36 public class UIRestServicesTest {
38 private UIRestServices service = null;
41 public void setUp() throws Exception {
42 service = new UIRestServices();
46 public void tearDown() throws Exception {
50 public void testHello() {
54 } catch (NullPointerException e) {
61 public void testGetApiKeysTable() {
64 service.getApiKeysTable();
65 } catch (NullPointerException e) {
73 public void testGetApiKey() {
76 service.getApiKey("apikey");
77 } catch (NullPointerException e) {
84 public void testGetTopicsTable() {
87 service.getTopicsTable();
88 } catch (NullPointerException e) {
95 public void testGetTopic() {
98 service.getTopic("topicName");
99 } catch (NullPointerException e) {
106 public void testGetDmaapContext() {
108 Method method = null;
110 clazz = Class.forName("UIRestServices");
111 Object obj = clazz.newInstance();
112 method = clazz.getDeclaredMethod("getDmaapContext", null);
113 method.setAccessible(true);
114 method.invoke(obj, null);
115 } catch (ClassNotFoundException e) {
116 // TODO Auto-generated catch block
118 } catch (NoSuchMethodException e) {
119 // TODO Auto-generated catch block
121 } catch (SecurityException e) {
122 // TODO Auto-generated catch block
124 } catch (InstantiationException e) {
125 // TODO Auto-generated catch block
127 } catch (IllegalAccessException e) {
128 // TODO Auto-generated catch block
130 } catch (IllegalArgumentException e) {
131 // TODO Auto-generated catch block
133 } catch (InvocationTargetException e) {
134 // TODO Auto-generated catch block