@Override
    public List<String> getRegisterData(final String key) {
        try {
            List<InstanceInfo> instances = eurekaClient.getInstancesByVipAddressAndAppName(null, key, true);
            List<String> registerDataList = new ArrayList<>();
            for (InstanceInfo instanceInfo : instances) {
                String instanceInfoJson = buildUpstreamJsonFromInstanceInfo(instanceInfo);
                registerDataList.add(instanceInfoJson);
            }
            return registerDataList;
        } catch (Exception e) {
            throw new ShenyuException(e);
        }
    }
@Test
    void testGetRegisterData() {
        final String key = "testService";
        final List<InstanceInfo> instances = new ArrayList<>();
        instances.add(mock(InstanceInfo.class));
        when(eurekaClient.getInstancesByVipAddressAndAppName(null, key, true)).thenReturn(instances);

        final InstanceInfo instanceInfo = instances.get(0);
        when(instanceInfo.getIPAddr()).thenReturn("127.0.0.1");
        when(instanceInfo.getPort()).thenReturn(8080);
        final Map<String, String> metadata = new HashMap<>();
        metadata.put("key1", "value1");
        when(instanceInfo.getMetadata()).thenReturn(metadata);
        when(instanceInfo.getStatus()).thenReturn(InstanceInfo.InstanceStatus.UP);

        final List<String> registerDataList = eurekaDiscoveryServiceUnderTest.getRegisterData(key);

        assertNotNull(registerDataList);
        assertFalse(registerDataList.isEmpty());
        final String expectedJson = buildUpstreamJsonFromInstanceInfo(instanceInfo);
        assertEquals(expectedJson, registerDataList.get(0));
    }