bump the version
[dmaap/messagerouter/msgrtr.git] / src / test / java / com / att / nsa / cambria / metabroker / BrokerImplTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP Policy Engine\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 \r
22 package com.att.nsa.cambria.metabroker;\r
23 \r
24 import static org.junit.Assert.*;\r
25 \r
26 import org.junit.After;\r
27 import org.junit.Before;\r
28 import org.junit.Test;\r
29 \r
30 import com.att.dmf.mr.CambriaApiException;\r
31 import com.att.dmf.mr.metabroker.Broker.TopicExistsException;\r
32 import com.att.nsa.configs.ConfigDbException;\r
33 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;\r
34 \r
35 public class BrokerImplTest {\r
36 \r
37         @Before\r
38         public void setUp() throws Exception {\r
39         }\r
40 \r
41         @After\r
42         public void tearDown() throws Exception {\r
43         }\r
44 \r
45         @Test\r
46         public void testGetOwners() {\r
47 \r
48                 try {\r
49                         new BrokerImpl().getAllTopics();\r
50                 } catch (ConfigDbException e) {\r
51                         // TODO Auto-generated catch block\r
52                         e.printStackTrace();\r
53                 }\r
54 \r
55                 assertTrue(true);\r
56         }\r
57 \r
58         @Test\r
59         public void testGetTopic() {\r
60 \r
61                 try {\r
62                         new BrokerImpl().getTopic("topicName");\r
63                 } catch (ConfigDbException e) {\r
64                         // TODO Auto-generated catch block\r
65                         e.printStackTrace();\r
66                 }\r
67 \r
68                 assertTrue(true);\r
69 \r
70         }\r
71 \r
72         @Test\r
73         public void testCreateTopic() {\r
74 \r
75                 try {\r
76                         new BrokerImpl().createTopic("topicName", "testing topic", "owner123", 3, 3, true);\r
77 \r
78                 } catch (CambriaApiException e) {\r
79                         // TODO Auto-generated catch block\r
80                         e.printStackTrace();\r
81                 } catch (TopicExistsException e) {\r
82                         // TODO Auto-generated catch block\r
83                         e.printStackTrace();\r
84                 }\r
85 \r
86                 assertTrue(true);\r
87 \r
88         }\r
89 \r
90         @Test\r
91         public void testDeleteTopic() {\r
92 \r
93                 try {\r
94                         new BrokerImpl().deleteTopic("topicName");\r
95                 } catch (CambriaApiException e) {\r
96                         // TODO Auto-generated catch block\r
97                         e.printStackTrace();\r
98                 } catch (AccessDeniedException e) {\r
99                         // TODO Auto-generated catch block\r
100                         e.printStackTrace();\r
101                 } catch (TopicExistsException e) {\r
102                         // TODO Auto-generated catch block\r
103                         e.printStackTrace();\r
104                 }\r
105 \r
106                 assertTrue(true);\r
107 \r
108         }\r
109 }\r