Aias00 commented on code in PR #6337:
URL: https://github.com/apache/shenyu/pull/6337#discussion_r3198460695


##########
shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java:
##########
@@ -85,20 +89,7 @@ public class SpringWebSocketClientEventListenerTest {
     @BeforeEach
     public void setUp() {
         MockitoAnnotations.openMocks(this);
-        Properties properties = mock(Properties.class);
-        when(properties.getProperty("appName")).thenReturn("appName");
-        when(properties.getProperty("contextPath")).thenReturn("contextPath");
-        
when(properties.getProperty(ShenyuClientConstants.PORT)).thenReturn("8080");
-        
when(properties.getProperty(ShenyuClientConstants.HOST)).thenReturn("127.0.0.1");
-        
when(properties.getProperty(ShenyuClientConstants.IP_PORT)).thenReturn("127.0.0.1:8080");
-        
-        ShenyuClientConfig clientConfig = mock(ShenyuClientConfig.class);
-        Map<String, ClientPropertiesConfig> client = new HashMap<>();
-        ClientPropertiesConfig clientPropertiesConfig = new 
ClientPropertiesConfig();
-        clientPropertiesConfig.setProps(properties);
-        client.put(RpcTypeEnum.WEB_SOCKET.getName(), clientPropertiesConfig);
-        when(clientConfig.getClient()).thenReturn(client);
-        eventListener = new SpringWebSocketClientEventListener(clientConfig, 
registerRepository);
+        eventListener = buildEventListener(false);

Review Comment:
   Removed `MockitoAnnotations.openMocks(this)` and the unused import. 
`@ExtendWith(MockitoExtension.class)` now owns mock initialization for this 
test.



-- 
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