use of org.apache.samza.table.remote.TableRateLimiter in project samza by apache.
the class TestRemoteTableEndToEnd method testCatchWriterException.
@Test(expected = SamzaException.class)
public void testCatchWriterException() {
TableReadFunction<String, String> reader = mock(TableReadFunction.class);
TableWriteFunction<String, String, Void> writer = mock(TableWriteFunction.class);
CompletableFuture<String> future = new CompletableFuture<>();
future.completeExceptionally(new RuntimeException("Expected test exception"));
doReturn(future).when(writer).putAsync(anyString(), any());
TableRateLimiter rateLimitHelper = mock(TableRateLimiter.class);
RemoteTable<String, String, Void> table = new RemoteTable<>("table1", reader, writer, rateLimitHelper, rateLimitHelper, rateLimitHelper, Executors.newSingleThreadExecutor(), null, null, null, null, null, null);
table.init(createMockContext());
table.put("abc", "efg");
}
Aggregations