@Override
    public void register(final String key, final String value) {
        try {
            KV kvClient = etcdClient.getKVClient();
            String uuid = UUIDUtils.getInstance().generateShortUuid();
            PutOption putOption = PutOption.newBuilder().withPrevKV().withLeaseId(leaseId).build();
            kvClient.put(bytesOf(key + "/" + uuid), bytesOf(value), putOption).get(timeout, TimeUnit.MILLISECONDS);
            LOGGER.info("etcd client key: {} with value: {}", key, value);
        } catch (InterruptedException | ExecutionException | TimeoutException e) {
            LOGGER.error("etcd client register (key:{},value:{}) error.", key, value, e);
            throw new ShenyuException(e);
        }
    }
@Test
    void registerTest() throws ExecutionException, InterruptedException, TimeoutException {
        final String key = "key";
        final String value = "value";

        final KV kvClient = mock(KV.class);
        when(etcdClient.getKVClient()).thenReturn(kvClient);

        final PutResponse putResponse = mock(PutResponse.class);
        final CompletableFuture<PutResponse> completableFuture = mock(CompletableFuture.class);
        when(completableFuture.get(anyLong(), any(TimeUnit.class)))
                .thenReturn(putResponse);
        when(kvClient.put(any(ByteSequence.class), any(ByteSequence.class), any(PutOption.class)))
                .thenReturn(completableFuture);
        etcdDiscoveryServiceUnderTest.register(key, value);

        doThrow(new InterruptedException()).when(completableFuture).get(anyLong(), any(TimeUnit.class));
        assertThrows(ShenyuException.class, () -> etcdDiscoveryServiceUnderTest.register(key, value));
    }