DMAAP-MR - Merge MR repos
[dmaap/messagerouter/messageservice.git] / src / test / java / org / onap / dmaap / mr / cambria / service / impl / ShowConsumerCacheTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy Engine
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21  package org.onap.dmaap.mr.cambria.service.impl;
22
23 //@RunWith(MockitoJUnitRunner.class)
24 //@RunWith(PowerMockRunner.class)
25 //@PrepareForTest(PropertiesMapBean.class)
26 public class ShowConsumerCacheTest {
27 /*
28 @InjectMocks
29 TopicServiceImpl topicService;
30
31 @Mock
32 private DMaaPErrorMessages errorMessages;
33
34 @Mock
35 DMaaPContext dmaapContext;
36
37 @Mock
38 ConfigurationReader configReader;
39
40
41 @Mock
42 JSONObject consumers;
43
44 @Mock
45 JSONObject consumerObject;
46
47 @Mock
48 JSONArray jsonConsumersList;
49
50 @Mock
51 DMaaPAuthenticator<NsaSimpleApiKey> dmaaPAuthenticator;
52
53 @Mock
54 NsaApiKey user;
55
56 @Mock
57 NsaSimpleApiKey nsaSimpleApiKey;
58
59 @Mock
60 HttpServletRequest httpServReq;
61
62
63 @Before
64 public void setUp(){
65 MockitoAnnotations.initMocks(this);
66 }
67
68
69 //@Test(expected = DMaaPAccessDeniedException.class)
70 @Test
71 public void testShowConsmerCache()throws DMaaPAccessDeniedException, CambriaApiException, IOException, TopicExistsException, JSONException{
72 Assert.assertNotNull(topicService);
73
74 String myName = "Brian";
75 Object created = null;
76 Object accessed = null;
77 Object log = null;
78 Object info = null;
79
80 when(consumerObject.put("name", myName)).thenReturn(consumerObject);
81 when(consumerObject.put("created", created)).thenReturn(consumerObject);
82 when(consumerObject.put("accessed", accessed)).thenReturn(consumerObject);
83 when(consumerObject.put("accessed", Consumer.class)).thenReturn(consumerObject);
84 when(jsonConsumersList.put(consumerObject)).thenReturn(null);
85
86 when(consumers.put("consumers", jsonConsumersList)).thenReturn(consumerObject);
87
88
89
90 }*/
91
92
93 }