public static NacosNamingServiceWrapper createNamingService(URL connectionURL) {
        boolean check = connectionURL.getParameter(NACOS_CHECK_KEY, true);
        int retryTimes = connectionURL.getPositiveParameter(NACOS_RETRY_KEY, 10);
        int sleepMsBetweenRetries = connectionURL.getPositiveParameter(NACOS_RETRY_WAIT_KEY, 10);
        NacosConnectionManager nacosConnectionManager =
                new NacosConnectionManager(connectionURL, check, retryTimes, sleepMsBetweenRetries);
        return new NacosNamingServiceWrapper(nacosConnectionManager, retryTimes, sleepMsBetweenRetries);
    }
@Test
    void testRequest() {
        try (MockedStatic<NacosFactory> nacosFactoryMockedStatic = Mockito.mockStatic(NacosFactory.class)) {
            AtomicInteger atomicInteger = new AtomicInteger(0);
            NamingService mock = new MockNamingService() {
                @Override
                public List<Instance> getAllInstances(String serviceName, boolean subscribe) throws NacosException {
                    if (atomicInteger.incrementAndGet() > 10) {
                        return null;
                    } else {
                        throw new NacosException();
                    }
                }

                @Override
                public String getServerStatus() {
                    return UP;
                }
            };
            nacosFactoryMockedStatic
                    .when(() -> NacosFactory.createNamingService((Properties) any()))
                    .thenReturn(mock);

            URL url = URL.valueOf("nacos://127.0.0.1:8848")
                    .addParameter("nacos.retry", 5)
                    .addParameter("nacos.retry-wait", 10);
            Assertions.assertThrows(
                    IllegalStateException.class, () -> NacosNamingServiceUtils.createNamingService(url));

            try {
                NacosNamingServiceUtils.createNamingService(url);
            } catch (Throwable t) {
                Assertions.fail(t);
            }
        }
    }