public List<NacosServiceInstance> getInstances(String serviceId) {
        try {
            return Optional.of(nacosServiceDiscovery.getInstances(serviceId))
                    .map(instances -> {
                        ServiceCache.setInstances(serviceId, instances);
                        return instances;
                    }).get();
        } catch (NacosException e) {
            LOGGER.log(Level.SEVERE, String.format(Locale.ENGLISH, "getInstances failed from nacos，"
                    + "serviceId={%s}，isFailureToleranceEnabled={%s}", serviceId,
                    nacosRegisterConfig.isFailureToleranceEnabled()), e);
            if (nacosRegisterConfig.isFailureToleranceEnabled()) {
                return ServiceCache.getInstances(serviceId);
            }
            return Collections.emptyList();
        }
    }
@Test
    public void testGetInstances() throws NacosException {
        mockNamingService();
        Assert.assertNotNull(nacosClient.getInstances("test"));
    }