use of com.coreos.jetcd.options.PutOption in project jetcd by coreos.
the class KVTest method testPutWithNotExistLease.
@Test
public void testPutWithNotExistLease() throws Exception {
ByteString sampleKey = ByteString.copyFrom("sample_key", "UTF-8");
ByteString sampleValue = ByteString.copyFrom("sample_value", "UTF-8");
PutOption option = PutOption.newBuilder().withLeaseId(99999).build();
ListenableFuture<PutResponse> feature = kvClient.put(sampleKey, sampleValue, option);
try {
PutResponse response = feature.get();
test.assertTrue(response.hasHeader());
} catch (Exception e) {
// empty
}
}
Aggregations