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.mr.cambria.metabroker;
23 import static org.junit.Assert.*;
25 import org.junit.After;
26 import org.junit.Before;
27 import org.junit.Test;
29 import com.att.nsa.configs.ConfigDbException;
30 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
32 public class TopicImplemTest {
35 public void setUp() throws Exception {
39 public void tearDown() throws Exception {
44 public void testGetOwners() {
46 assertNotNull(new TopicImplem().getOwner());
51 public void testGetName() {
53 assertNotNull(new TopicImplem().getName());
58 public void testGetOwner() {
60 assertNotNull(new TopicImplem().getOwner());
65 public void testGetDescription() {
67 assertNotNull(new TopicImplem().getDescription());
72 public void testIsTransactionEnabled() {
74 assertTrue(new TopicImplem().isTransactionEnabled());
79 public void testGetReaderAcl() {
80 new TopicImplem().getReaderAcl();
86 public void testGetWriterAcl() {
87 new TopicImplem().getReaderAcl();
94 public void testCheckUserRead() {
96 new TopicImplem().checkUserRead(null);
97 } catch (AccessDeniedException e) {
98 // TODO Auto-generated catch block
106 public void testCheckUserWrite() {
108 new TopicImplem().checkUserWrite(null);
109 } catch (AccessDeniedException e) {
110 // TODO Auto-generated catch block
118 public void testPermitWritesFromUser() {
120 new TopicImplem().permitWritesFromUser("publisherId", null);
121 } catch (AccessDeniedException e) {
122 // TODO Auto-generated catch block
124 } catch (ConfigDbException e) {
125 // TODO Auto-generated catch block
133 public void testDenyWritesFromUser() {
135 new TopicImplem().denyWritesFromUser("publisherId", null);
136 } catch (AccessDeniedException e) {
137 // TODO Auto-generated catch block
139 } catch (ConfigDbException e) {
140 // TODO Auto-generated catch block
148 public void testPermitReadsByUser() {
150 new TopicImplem().permitReadsByUser("consumerId", null);
151 } catch (AccessDeniedException e) {
152 // TODO Auto-generated catch block
154 } catch (ConfigDbException e) {
155 // TODO Auto-generated catch block
163 public void testDenyReadsByUser() {
165 new TopicImplem().denyReadsByUser("consumerId", null);
166 } catch (AccessDeniedException e) {
167 // TODO Auto-generated catch block
169 } catch (ConfigDbException e) {
170 // TODO Auto-generated catch block