@Override
    public List<String> getRegisterData(final String key) {
        try {
            KV kvClient = etcdClient.getKVClient();
            GetOption option = GetOption.newBuilder().isPrefix(true).build();
            GetResponse response = kvClient.get(bytesOf(key), option).get();
            return response.getKvs().stream()
                    .filter(o -> !o.getKey().equals(ByteSequence.from(key, StandardCharsets.UTF_8)))
                    .map(kv -> kv.getValue().toString(StandardCharsets.UTF_8))
                    .collect(Collectors.toList());
        } catch (Exception e) {
            LOGGER.error("etcd client get registered data with key: {} error", key, e);
            throw new ShenyuException(e);
        }
    }
@Test
    void testGetRegisterData() throws InterruptedException, ExecutionException {
        final String key = "key";
        final KV kv = mock(KV.class);
        when(etcdClient.getKVClient()).thenReturn(kv);
        final GetResponse getResponse = mock(GetResponse.class);
        when(getResponse.getKvs()).thenReturn(Collections.emptyList());
        final CompletableFuture<GetResponse> completableFuture = mock(CompletableFuture.class);
        when(completableFuture.get()).thenReturn(getResponse);
        when(kv.get(any(ByteSequence.class), any(GetOption.class))).thenReturn(completableFuture);
        assertDoesNotThrow(() -> etcdDiscoveryServiceUnderTest.getRegisterData(key));
        doThrow(new InterruptedException("test")).when(completableFuture).get();
        assertThrows(ShenyuException.class, () -> etcdDiscoveryServiceUnderTest.getRegisterData(key));
    }