- @Test
- public void testDmaapService_publish_ok() throws Exception {
- PowerMock.resetAll();
- PolicyMsg policyMsg = new PolicyMsg();
- PowerMock.expectPrivate(publisher, "publish", anyObject(PolicyMsg.class)).andReturn(true)
- .anyTimes();
- PowerMock.replayAll();
- Whitebox.invokeMethod(dmaapService, "publishPolicyMsg", policyMsg);
- PowerMock.verifyAll();
- }
-
- @Test
- public void testDmaapService_publish_exception() throws Exception {
- PowerMock.resetAll();
- final PolicyMsg policyMsg = new PolicyMsg();
- PowerMock.expectPrivate(publisher, "publish", policyMsg)
- .andThrow(new CorrelationException("")).anyTimes();
- PowerMock.replayAll();
- Whitebox.invokeMethod(dmaapService, "publishPolicyMsg", policyMsg);
- PowerMock.verifyAll();
- }
-