private AaiQuery aaiQuery;
+ private DmaapService dmaapService;
+
@Before
public void setUp() {
+ dmaapService = new DmaapService();
publisher = PowerMock.createMock(Publisher.class);
- Whitebox.setInternalState(DmaapService.class, "publisher", publisher);
+ Whitebox.setInternalState(dmaapService, "publisher", publisher);
aaiQuery = PowerMock.createMock(AaiQuery.class);
- Whitebox.setInternalState(DmaapService.class, "aaiQuery", aaiQuery);
- PowerMock.replayAll();
+ Whitebox.setInternalState(dmaapService, "aaiQuery", aaiQuery);
}
@Test
PowerMock.expectPrivate(publisher, "publish", anyObject(PolicyMsg.class)).andReturn(true)
.anyTimes();
PowerMock.replayAll();
- Whitebox.invokeMethod(DmaapService.class, "publishPolicyMsg", policyMsg);
+ Whitebox.invokeMethod(dmaapService, "publishPolicyMsg", policyMsg);
PowerMock.verifyAll();
}
PowerMock.expectPrivate(publisher, "publish", policyMsg)
.andThrow(new CorrelationException("")).anyTimes();
PowerMock.replayAll();
- Whitebox.invokeMethod(DmaapService.class, "publishPolicyMsg", policyMsg);
+ Whitebox.invokeMethod(dmaapService, "publishPolicyMsg", policyMsg);
PowerMock.verifyAll();
}
PowerMock.replayAll();
PolicyMsg policyMsg = Whitebox
- .invokeMethod(DmaapService.class, "getDefaultPolicyMsg", "tetss");
+ .invokeMethod(dmaapService, "getDefaultPolicyMsg", "tetss");
PowerMock.verifyAll();
assertThat(policyMsg.getTarget(), equalTo("vserver.vserver-name"));
anyObject(String.class)).andReturn(expect).anyTimes();
PowerMock.replayAll();
VnfEntity actual = Whitebox
- .invokeMethod(DmaapService.class, "getVnfEntity", "tset", "test");
+ .invokeMethod(dmaapService, "getVnfEntity", "tset", "test");
PowerMock.verifyAll();
assertThat(actual.getVnfName(), equalTo("test"));
PowerMock.expectPrivate(aaiQuery, "getAaiVnfData", anyObject(String.class),
anyObject(String.class)).andThrow(new CorrelationException("")).anyTimes();
PowerMock.replayAll();
- VnfEntity actual = Whitebox.invokeMethod(DmaapService.class, "getVnfEntity", "tset", "test");
+ VnfEntity actual = Whitebox.invokeMethod(dmaapService, "getVnfEntity", "tset", "test");
PowerMock.verifyAll();
assertThat(actual == null, equalTo(true));
anyObject(String.class)).andReturn(expect).anyTimes();
PowerMock.replayAll();
VmEntity actual = Whitebox
- .invokeMethod(DmaapService.class, "getVmEntity", "tset", "test");
+ .invokeMethod(dmaapService, "getVmEntity", "tset", "test");
PowerMock.verifyAll();
assertThat(actual.getVserverId(), equalTo("11111"));
PowerMock.expectPrivate(aaiQuery, "getAaiVmData", anyObject(String.class),
anyObject(String.class)).andThrow(new CorrelationException("")).anyTimes();
PowerMock.replayAll();
- VnfEntity actual = Whitebox.invokeMethod(DmaapService.class, "getVmEntity", "tset", "test");
+ VnfEntity actual = Whitebox.invokeMethod(dmaapService, "getVmEntity", "tset", "test");
PowerMock.verifyAll();
assertThat(actual == null, equalTo(true));
vnfEntity.getRelationshipList().setRelationships(relationships);
PowerMock.replayAll();
- String actual = Whitebox.invokeMethod(DmaapService.class, "getVserverInstanceId", vnfEntity);
+ String actual = Whitebox.invokeMethod(dmaapService, "getVserverInstanceId", vnfEntity);
PowerMock.verifyAll();
assertThat(actual, equalTo("USUCP0PCOIL0110UJZZ01"));
VnfEntity vnfEntity = null;
PowerMock.replayAll();
- String actual = Whitebox.invokeMethod(DmaapService.class, "getVserverInstanceId", vnfEntity);
+ String actual = Whitebox.invokeMethod(dmaapService, "getVserverInstanceId", vnfEntity);
PowerMock.verifyAll();
assertThat(actual, equalTo(""));
vesAlarm.setEventId("11111");
vesAlarm.setEventName("3333");
- PowerMock.expectPrivate(DmaapService.class, "getVnfEntity", anyObject(String.class),
+ PowerMock.expectPrivate(dmaapService, "getVnfEntity", anyObject(String.class),
anyObject(String.class)).andReturn(null).anyTimes();
PowerMock.replayAll();
PolicyMsg actual = Whitebox
- .invokeMethod(DmaapService.class, "getEnrichedPolicyMsg", vmEntity, vesAlarm);
+ .invokeMethod(dmaapService, "getEnrichedPolicyMsg", vmEntity, vesAlarm);
PowerMock.verifyAll();
assertThat(actual.getPolicyName(), equalTo("vLoadBalancer"));