mdedetrich commented on code in PR #12725:
URL: https://github.com/apache/kafka/pull/12725#discussion_r1003458373


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResourceTest.java:
##########
@@ -153,19 +157,23 @@ public class ConnectorsResourceTest {
     @Mock
     private WorkerConfig workerConfig;
 
+    private MockedStatic<RestClient> restClientStatic;
+
     @Before
     public void setUp() throws NoSuchMethodException {
-        PowerMock.mockStatic(RestClient.class,
-                RestClient.class.getMethod("httpRequest", String.class, 
String.class, HttpHeaders.class, Object.class, TypeReference.class, 
WorkerConfig.class));
-        
EasyMock.expect(workerConfig.getBoolean(TOPIC_TRACKING_ENABLE_CONFIG)).andReturn(true);
-        
EasyMock.expect(workerConfig.getBoolean(TOPIC_TRACKING_ALLOW_RESET_CONFIG)).andReturn(true);
-        PowerMock.replay(workerConfig);
+        restClientStatic = mockStatic(RestClient.class);
+        
when(workerConfig.getBoolean(TOPIC_TRACKING_ENABLE_CONFIG)).thenReturn(true);
+        
when(workerConfig.getBoolean(TOPIC_TRACKING_ALLOW_RESET_CONFIG)).thenReturn(true);
         connectorsResource = new ConnectorsResource(herder, workerConfig);
-        forward = EasyMock.mock(UriInfo.class);
+        forward = mock(UriInfo.class);
         MultivaluedMap<String, String> queryParams = new 
MultivaluedHashMap<>();
         queryParams.putSingle("forward", "true");
-        
EasyMock.expect(forward.getQueryParameters()).andReturn(queryParams).anyTimes();
-        EasyMock.replay(forward);
+        when(forward.getQueryParameters()).thenReturn(queryParams);
+    }
+
+    @After
+    public void teardown() {
+        restClientStatic.close();

Review Comment:
   So this indeed this end up catching something at 
`testResetConnectorActiveTopics`, specifically 
`herder.resetConnectorActiveTopics(CONNECTOR_NAME);`. Have already started 
looking into it.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to