olalamichelle commented on code in PR #14078: URL: https://github.com/apache/kafka/pull/14078#discussion_r1299213610
########## clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksTest.java: ########## @@ -195,4 +231,68 @@ public String getBody() { return Mockito.spy(httpsJwks); } + /** + * A mock ScheduledExecutorService just for the test. Note that this is not a generally reusable mock as it does not + * implement some interfaces like scheduleWithFixedDelay, etc. And it does not return ScheduledFuture correctly. + */ + private class MockExecutorService implements MockTime.Listener { + private final MockTime time; + + private final TreeMap<Long, List<AbstractMap.SimpleEntry<Long, KafkaFutureImpl<Long>>>> waiters = new TreeMap<>(); + + public MockExecutorService(MockTime time) { + this.time = time; + time.addListener(this); + } + + @Override + public synchronized void onTimeUpdated() { Review Comment: This is a test-only class so I think it should be fine? We should make sure scheduled thing does not have exceptions? -- 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