use of com.dell.cpsd.storage.capabilities.api.ListStorageResponseMessage in project fru-paqx-parent by dellemc-symphony.
the class ListStorageHandlerTest method isCompletedWhenReceivingResponse.
@Test
public void isCompletedWhenReceivingResponse() throws Exception {
final CountDownLatch countDownLatch = new CountDownLatch(1);
ListStorageResponseHandler handler = new ListStorageResponseHandler(null);
final CompletableFuture<ScaleIOSystemDataRestRep> future = handler.register("test-001");
future.whenComplete((systemRest, throwable) -> countDownLatch.countDown());
ListStorageResponseMessage listResponse = new ListStorageResponseMessage();
ScaleIOSystemDataRestRep scaleIOSystemDataRestRep = new ScaleIOSystemDataRestRep();
scaleIOSystemDataRestRep.setSystemVersionName("some.test");
listResponse.getScaleIOSystemDataRestRep();
MessageProperties messageProperties = new MessageProperties();
messageProperties.setCorrelationId("test-001");
listResponse.setMessageProperties(messageProperties);
handler.executeOperation(listResponse);
Assert.assertTrue("Timeout before completion", countDownLatch.await(1, TimeUnit.SECONDS));
}
Aggregations