renzhuyan commented on code in PR #3529:
URL: https://github.com/apache/incubator-shenyu/pull/3529#discussion_r894997546


##########
shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/test/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessorTest.java:
##########
@@ -89,12 +91,12 @@ public void testWithShenyuClientAnnotation() {
         registerUtilsMockedStatic.when(() -> RegisterUtils.doLogin(any(), 
any(), any())).thenReturn(Optional.of("token"));
         registerUtilsMockedStatic.when(() -> RegisterUtils.doRegister(any(), 
any(), any()))
                 .thenAnswer((Answer<Void>) invocation -> null);
-        SpringCloudClientBeanPostProcessor springCloudClientBeanPostProcessor 
= buildSpringCloudClientBeanPostProcessor(false);
-        assertThat(springCloudClientTestBean, 
equalTo(springCloudClientBeanPostProcessor.postProcessAfterInitialization(springCloudClientTestBean,
 "normalBean")));
+        SpringCloudClientBeanListener springCloudClientBeanListener = 
buildSpringCloudClientBeanPostProcessor(false);
+        
springCloudClientBeanListener.onApplicationEvent(contextRefreshedEvent);
         registerUtilsMockedStatic.close();

Review Comment:
   Method has no return value. I added the call count vetify.



##########
shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/test/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessorTest.java:
##########
@@ -58,29 +58,31 @@ public final class SpringCloudClientBeanPostProcessorTest {
 
     private final MockedStatic<RegisterUtils> registerUtilsMockedStatic = 
mockStatic(RegisterUtils.class);
 
-    private final SpringCloudClientTestBean springCloudClientTestBean = new 
SpringCloudClientTestBean();
+    @Mock
+    private ApplicationContext applicationContext;
+
+    private ContextRefreshedEvent contextRefreshedEvent;
 
     @BeforeEach
     public void init() {
         
when(env.getProperty("spring.application.name")).thenReturn("spring-cloud-test");
+        contextRefreshedEvent = new ContextRefreshedEvent(applicationContext);
     }
 
     @Test
     public void testShenyuBeanProcess() {
         registerUtilsMockedStatic.when(() -> RegisterUtils.doLogin(any(), 
any(), any())).thenReturn(Optional.of("token"));
         // config with full
-        SpringCloudClientBeanPostProcessor springCloudClientBeanPostProcessor 
= buildSpringCloudClientBeanPostProcessor(true);
-        assertThat(springCloudClientTestBean, 
equalTo(springCloudClientBeanPostProcessor.postProcessAfterInitialization(springCloudClientTestBean,
 "springCloudClientTestBean")));
+        SpringCloudClientBeanListener springCloudClientBeanListener = 
buildSpringCloudClientBeanPostProcessor(true);
+        
springCloudClientBeanListener.onApplicationEvent(contextRefreshedEvent);
         registerUtilsMockedStatic.close();

Review Comment:
   Method has no return value. I added the call count vetify.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to