yashmayya commented on code in PR #12615: URL: https://github.com/apache/kafka/pull/12615#discussion_r970342561
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/errors/RetryWithToleranceOperatorTest.java: ########## @@ -250,97 +258,90 @@ public void execAndHandleRetriableError(long errorRetryTimeout, int numRetriable assertTrue(retryWithToleranceOperator.failed()); } - EasyMock.verify(mockOperation); - PowerMock.verifyAll(); + verifyNoMoreInteractions(exitLatch); + verify(mockOperation, times(successExpected ? numRetriableExceptionsThrown + 1 : numRetriableExceptionsThrown)).call(); } @Test public void testExecAndHandleNonRetriableError() throws Exception { MockTime time = new MockTime(0, 0, 0); - CountDownLatch exitLatch = PowerMock.createStrictMock(CountDownLatch.class); + CountDownLatch exitLatch = mock(CountDownLatch.class); RetryWithToleranceOperator retryWithToleranceOperator = new RetryWithToleranceOperator(6000, ERRORS_RETRY_MAX_DELAY_DEFAULT, ALL, time, new ProcessingContext(), exitLatch); retryWithToleranceOperator.metrics(errorHandlingMetrics); - EasyMock.expect(mockOperation.call()).andThrow(new Exception("Test")).times(1); - - // expect no call to exitLatch.await() which is only called during the retry backoff - - replay(mockOperation, exitLatch); + when(mockOperation.call()).thenThrow(new Exception("Test")); String result = retryWithToleranceOperator.execAndHandleError(mockOperation, Exception.class); assertTrue(retryWithToleranceOperator.failed()); assertNull(result); - EasyMock.verify(mockOperation); - PowerMock.verifyAll(); + // expect no call to exitLatch.await() which is only called during the retry backoff + verify(mockOperation, times(1)).call(); Review Comment: No difference, just thought it could be more explicit here. I've changed it to be consistent 👍 ########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/errors/RetryWithToleranceOperatorTest.java: ########## @@ -379,14 +380,12 @@ public void testDefaultConfigs() { assertEquals(configuration.errorRetryTimeout(), ERRORS_RETRY_TIMEOUT_DEFAULT); assertEquals(configuration.errorMaxDelayInMillis(), ERRORS_RETRY_MAX_DELAY_DEFAULT); assertEquals(configuration.errorToleranceType(), ERRORS_TOLERANCE_DEFAULT); - - PowerMock.verifyAll(); } ConnectorConfig config(Map<String, String> connProps) { Map<String, String> props = new HashMap<>(); props.put(ConnectorConfig.NAME_CONFIG, "test"); - props.put(ConnectorConfig.CONNECTOR_CLASS_CONFIG, SinkTask.class.getName()); + props.put(ConnectorConfig.CONNECTOR_CLASS_CONFIG, SinkConnector.class.getName()); Review Comment: Nope, no new failures. Just happened to notice 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