@Test public void testDelete() throws Exception { DeleteResult<ByteBuf, ByteBuf> result = mock(DeleteResult.class); when(mockTable.delete(any(ByteBuf.class), eq(Options.delete()))) .thenReturn(FutureUtils.value(result)); stateContext.delete("test-key"); verify(mockTable, times(1)).delete( eq(Unpooled.copiedBuffer("test-key", UTF_8)), eq(Options.delete()) ); }
@Override public CompletableFuture<Void> delete(String key) { return table.delete( Unpooled.wrappedBuffer(key.getBytes(UTF_8)), Options.delete() ).thenApply(ignored -> null); }
StateContextImpl implements StateContext { @Override public CompletableFuture<Void> delete(String key) { return table.delete( Unpooled.wrappedBuffer(key.getBytes(UTF_8)), Options.delete() ).thenApply(ignored -> null); } }
StateContextImpl implements StateContext { @Override public CompletableFuture<Void> delete(String key) { return table.delete( Unpooled.wrappedBuffer(key.getBytes(UTF_8)), Options.delete() ).thenApply(ignored -> null); } StateContextImpl(Table<ByteBuf, ByteBuf> table); }
StateContextImpl implements StateContext { @Override public CompletableFuture<Void> delete(String key) { return table.delete( Unpooled.wrappedBuffer(key.getBytes(UTF_8)), Options.delete() ).thenApply(ignored -> null); } StateContextImpl(Table<ByteBuf, ByteBuf> table); @Override CompletableFuture<Void> incrCounter(String key, long amount); @Override CompletableFuture<Void> put(String key, ByteBuffer value); @Override CompletableFuture<Void> delete(String key); @Override CompletableFuture<ByteBuffer> get(String key); @Override CompletableFuture<Long> getCounter(String key); }
StateContextImpl implements StateContext { @Override public CompletableFuture<Void> delete(String key) { return table.delete( Unpooled.wrappedBuffer(key.getBytes(UTF_8)), Options.delete() ).thenApply(ignored -> null); } StateContextImpl(Table<ByteBuf, ByteBuf> table); @Override CompletableFuture<Void> incrCounter(String key, long amount); @Override CompletableFuture<Void> put(String key, ByteBuffer value); @Override CompletableFuture<Void> delete(String key); @Override CompletableFuture<ByteBuffer> get(String key); @Override CompletableFuture<Long> getCounter(String key);  }