Search in sources :

Example 1 with ListStorageResponseMessage

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));
}
Also used : MessageProperties(com.dell.cpsd.storage.capabilities.api.MessageProperties) ListStorageResponseMessage(com.dell.cpsd.storage.capabilities.api.ListStorageResponseMessage) ScaleIOSystemDataRestRep(com.dell.cpsd.storage.capabilities.api.ScaleIOSystemDataRestRep) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Aggregations

ListStorageResponseMessage (com.dell.cpsd.storage.capabilities.api.ListStorageResponseMessage)1 MessageProperties (com.dell.cpsd.storage.capabilities.api.MessageProperties)1 ScaleIOSystemDataRestRep (com.dell.cpsd.storage.capabilities.api.ScaleIOSystemDataRestRep)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Test (org.junit.Test)1