\r
package com.att.nsa.cambria.service.impl;\r
\r
-/*import static org.mockito.Matchers.anyBoolean;\r
+import static org.mockito.Matchers.anyBoolean;\r
import static org.mockito.Matchers.anyInt;\r
import static org.mockito.Matchers.anyString;\r
import static org.mockito.Mockito.times;\r
import static org.mockito.Mockito.verify;\r
-import static org.mockito.Mockito.when;*/\r
+import static org.mockito.Mockito.when;\r
\r
import java.io.IOException;\r
import java.util.Arrays;\r
import org.junit.Before;\r
import org.junit.Test;\r
import org.junit.runner.RunWith;\r
-/*import org.mockito.InjectMocks;\r
+import org.mockito.InjectMocks;\r
import org.mockito.Mock;\r
import org.mockito.MockitoAnnotations;\r
import org.powermock.api.mockito.PowerMockito;\r
import org.powermock.modules.junit4.PowerMockRunner;\r
\r
import com.att.ajsc.beans.PropertiesMapBean;\r
+import com.att.ajsc.filemonitor.AJSCPropertiesMap;\r
import com.att.nsa.cambria.CambriaApiException;\r
import com.att.nsa.cambria.beans.DMaaPContext;\r
import com.att.nsa.cambria.beans.DMaaPKafkaMetaBroker;\r
import com.att.nsa.cambria.security.DMaaPAuthenticator;\r
import com.att.nsa.cambria.utils.ConfigurationReader;\r
import com.att.nsa.cambria.utils.DMaaPResponseBuilder;\r
-import com.att.nsa.configs.ConfigDbException;*/\r
+import com.att.nsa.configs.ConfigDbException;\r
import com.att.nsa.security.NsaAcl;\r
import com.att.nsa.security.NsaApiKey;\r
import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;\r
import com.att.nsa.security.db.simple.NsaSimpleApiKey;\r
\r
//@RunWith(MockitoJUnitRunner.class)\r
-/*@RunWith(PowerMockRunner.class)\r
-@PrepareForTest({ PropertiesMapBean.class })*/\r
-public class TopicServiceImplTest22 {/*\r
+@RunWith(PowerMockRunner.class)\r
+@PrepareForTest({ PropertiesMapBean.class })\r
+public class TopicServiceImplTest22 {\r
\r
- @InjectMocks\r
+ \r
TopicServiceImpl topicService;\r
\r
@Mock\r
@Before\r
public void setUp() {\r
MockitoAnnotations.initMocks(this);\r
+ topicService = new TopicServiceImpl();\r
+ topicService.setErrorMessages(errorMessages);\r
}\r
\r
@Test(expected = DMaaPAccessDeniedException.class)\r
// \r
// \r
\r
- * @Test public void testdeleteTopic() throws DMaaPAccessDeniedException,\r
- * CambriaApiException, IOException, TopicExistsException, JSONException,\r
- * ConfigDbException, AccessDeniedException {\r
- * \r
- * Assert.assertNotNull(topicService);\r
- * \r
- * //PowerMockito.mockStatic(AJSCPropertiesMap.class);\r
- * PowerMockito.mockStatic(AJSCPropertiesMap.class);\r
- * PowerMockito.when(AJSCPropertiesMap.getProperty(CambriaConstants.\r
- * msgRtr_prop,"msgRtr.topicfactory.aaf")) .thenReturn("hello");\r
- * \r
- * when(dmaaPAuthenticator.authenticate(dmaapContext)).thenReturn(null);\r
- * when(httpServReq.getHeader("AppName")).thenReturn("MyApp");\r
- * when(httpServReq.getHeader("Authorization")).thenReturn("Admin");\r
- * when(dmaapContext.getRequest()).thenReturn(httpServReq);\r
- * \r
- * when(configReader.getfSecurityManager()).thenReturn(dmaaPAuthenticator);\r
- * when(dmaapContext.getConfigReader()).thenReturn(configReader);\r
- * \r
- * TopicBean topicBean = new TopicBean();\r
- * topicBean.setTopicName("enfTopicNamePlusExtra");\r
- * \r
- * topicService.deleteTopic(dmaapContext, "topicNamespace.topic"); }\r
+ /*@Test public void testdeleteTopic() throws DMaaPAccessDeniedException,\r
+ CambriaApiException, IOException, TopicExistsException, JSONException,\r
+ ConfigDbException, AccessDeniedException {\r
+ \r
+ Assert.assertNotNull(topicService);\r
+ \r
+ //PowerMockito.mockStatic(AJSCPropertiesMap.class);\r
+ PowerMockito.mockStatic(AJSCPropertiesMap.class);\r
+ PowerMockito.when(AJSCPropertiesMap.getProperty(CambriaConstants.\r
+ msgRtr_prop,"msgRtr.topicfactory.aaf")) .thenReturn("hello");\r
+ \r
+ when(dmaaPAuthenticator.authenticate(dmaapContext)).thenReturn(null);\r
+ when(httpServReq.getHeader("AppName")).thenReturn("MyApp");\r
+ when(httpServReq.getHeader("Authorization")).thenReturn("Admin");\r
+ when(dmaapContext.getRequest()).thenReturn(httpServReq);\r
+ \r
+ when(configReader.getfSecurityManager()).thenReturn(dmaaPAuthenticator);\r
+ when(dmaapContext.getConfigReader()).thenReturn(configReader);\r
+ \r
+ TopicBean topicBean = new TopicBean();\r
+ topicBean.setTopicName("enfTopicNamePlusExtra");\r
+ \r
+ topicService.deleteTopic(dmaapContext, "topicNamespace.topic"); }*/\r
\r
\r
-*/}\r
+}\r