2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 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=========================================================
20 package org.onap.dmaap.dbcapi.model;
22 import static org.junit.Assert.*;
24 import java.lang.reflect.Constructor;
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;
31 public class DmaapTest {
32 String ver, tnr, dn, dpu, lu, bat, nk, ako;
35 public void setUp() throws Exception {
37 tnr = "org.onap.dmaap";
39 dpu = "https://drps.dmaap.onap.org:8081";
40 lu = "http://drps.dmaap.onap.org:8080/feedlog";
41 bat = "org.onap.dcae.dmaap.MM_AGENT_TOPIC";
47 public void tearDown() throws Exception {
52 public void testDmaapClassDefaultConstructor() {
54 Dmaap t = new Dmaap();
56 assertTrue( t.getVersion() == null );
57 assertTrue( t.getTopicNsRoot() == null );
58 assertTrue( t.getDmaapName() == null );
59 assertTrue( t.getDrProvUrl() == null );
60 assertTrue( t.getLoggingUrl() == null );
61 assertTrue( t.getBridgeAdminTopic() == null );
62 assertTrue( t.getNodeKey() == null );
63 assertTrue( t.getAccessKeyOwner() == null );
68 public void testDmaapClassConstructor() {
70 Dmaap t = new Dmaap( ver, tnr, dn, dpu, lu, bat, nk, ako );
72 assertTrue( ver.equals( t.getVersion() ));
73 assertTrue( tnr.equals( t.getTopicNsRoot() ));
74 assertTrue( dn.equals( t.getDmaapName() ));
75 assertTrue( dpu.equals( t.getDrProvUrl() ));
76 assertTrue( lu.equals( t.getLoggingUrl() ));
77 assertTrue( bat.equals( t.getBridgeAdminTopic() ));
78 assertTrue( nk.equals( t.getNodeKey() ));
79 assertTrue( ako.equals( t.getAccessKeyOwner() ));
84 public void testDmaapClassSetters() {
86 Dmaap t = new Dmaap();
89 assertTrue( ver.equals( t.getVersion() ));
90 t.setTopicNsRoot( tnr );
91 assertTrue( tnr.equals( t.getTopicNsRoot() ));
93 assertTrue( dn.equals( t.getDmaapName() ));
94 t.setDrProvUrl( dpu );
95 assertTrue( dpu.equals( t.getDrProvUrl() ));
96 t.setLoggingUrl( lu );
97 assertTrue( lu.equals( t.getLoggingUrl() ));
98 t.setBridgeAdminTopic( bat );
99 assertTrue( bat.equals( t.getBridgeAdminTopic() ));
101 assertTrue( nk.equals( t.getNodeKey() ));
102 t.setAccessKeyOwner( ako );
103 assertTrue( ako.equals( t.getAccessKeyOwner() ));