@Override
    public void registerBeanDefinitions(final AnnotationMetadata metadata, final BeanDefinitionRegistry registry) {
        registerDefaultConfiguration(metadata, registry);
        registerShenyuClients(metadata, registry);
    }
@Test
    @DisabledForJreRange(min = JRE.JAVA_16)
    public void registerBeanDefinitionsTest() throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        ((DefaultListableBeanFactory) context.getBeanFactory()).setAllowBeanDefinitionOverriding(false);
        context.register(FeignAutoConfiguration.class);
        context.register(FeignClientsConfiguration.class);
        //context.register(HttpClientConfiguration.class);
        context.register(ShenyuTestConfig.class);
        context.register(HttpMessageConvertersAutoConfiguration.class);

        when(feignBlockingLoadBalancerClient.getDelegate()).thenReturn(delegate);
        context.registerBean(FeignBlockingLoadBalancerClient.class, () -> feignBlockingLoadBalancerClient);

        final RegisterConfig config = spy(RegisterConfig.class);
        when(config.getServerLists()).thenReturn("localhost:1234");

        final ShenyuDiscoveryClient shenyuDiscoveryClient = spy(new ShenyuDiscoveryClient(config));
        context.registerBean(ShenyuDiscoveryClient.class, () -> shenyuDiscoveryClient);
        context.refresh();

        final ShenyuClientsRegistrarTest.ShenyuApiClient apiClient = context.getBean(ShenyuClientsRegistrarTest.ShenyuApiClient.class);

        Object invocationHandler = ReflectionTestUtils.getField(apiClient, "h");
        assertNotNull(invocationHandler);
        Target.HardCodedTarget factoryBean = (Target.HardCodedTarget) ReflectionTestUtils.getField(invocationHandler, "target");
        assertNotNull(factoryBean);
        assertEquals(factoryBean.name(), "shenyuApiClient");
        assertEquals(factoryBean.url(), "http://shenyuApiClient/dev/api");
        assertEquals(factoryBean.type(), ShenyuApiClient.class);

        final Response respSpy = spy(Response.builder()
                                         .body("1", StandardCharsets.UTF_8)
                                         .status(HttpStatus.OK.value())
                                         .request(Request.create(Request.HttpMethod.POST, "/dev/null", Maps.newHashMap(), null, null, null))
                                         .build());
        when(delegate.execute(any(), any())).thenReturn(respSpy);
        assertThrowsExactly(DecodeException.class, () -> apiClient.del("id"));
        verify(delegate, times(1)).execute(any(), any());
        verify(shenyuDiscoveryClient, times(1)).getInstance(anyString());
    }