use of io.pravega.controller.store.task.LockFailedException in project pravega by pravega.
the class TaskTest method testLocking.
@Test
public void testLocking() {
TestTasks testTasks = new TestTasks(taskMetadataStore, executor, HOSTNAME);
CompletableFuture<Void> first = testTasks.testStreamLock(SCOPE, stream1);
CompletableFuture<Void> second = testTasks.testStreamLock(SCOPE, stream1);
try {
first.getNow(null);
second.getNow(null);
} catch (CompletionException ce) {
assertTrue(ce.getCause() instanceof LockFailedException);
}
}
Aggregations