Example usage for java.util.concurrent Future get

List of usage examples for java.util.concurrent Future get

Introduction

In this page you can find the example usage for java.util.concurrent Future get.

Prototype

V get() throws InterruptedException, ExecutionException;

Source Link

Document

Waits if necessary for the computation to complete, and then retrieves its result.

Usage

From source file:com.awstrainers.devcourse.sdkdemos.DynamoDBTest.java

@Test
public void checkAsyncOperation() throws Exception {
    AmazonDynamoDBAsync client = new AmazonDynamoDBAsyncClient();
    client.setRegion(Region.getRegion(Regions.US_EAST_1));
    Future<DescribeTableResult> future = client
            .describeTableAsync(new DescribeTableRequest().withTableName(tableName));
    DescribeTableResult result = future.get();
    Assert.assertNotNull("A null result indicates the program didn't wait. ", result);
}