You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2025/01/12 21:52:18 UTC

(kafka) branch 4.0 updated: MINOR: fix LogOffsetTest in 4.0 (#18495)

This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch 4.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/4.0 by this push:
     new 699db8a99f2 MINOR: fix LogOffsetTest in 4.0 (#18495)
699db8a99f2 is described below

commit 699db8a99f2f6a2b01507d10cfc8d01e62840622
Author: TaiJuWu <tj...@gmail.com>
AuthorDate: Mon Jan 13 05:52:12 2025 +0800

    MINOR: fix LogOffsetTest in 4.0 (#18495)
    
    Convert Some to Optional
    
    Reviewers: Ismael Juma <is...@juma.me.uk>
---
 core/src/test/scala/unit/kafka/server/LogOffsetTest.scala | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala b/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
index 1b6564c0505..dc3e7d7c6ab 100755
--- a/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
+++ b/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
@@ -82,7 +82,7 @@ class LogOffsetTest extends BaseRequestTest {
     log.deleteOldSegments()
 
     val offset = log.fetchOffsetByTimestamp(ListOffsetsRequest.LATEST_TIMESTAMP).timestampAndOffsetOpt.map(_.offset)
-    assertEquals(Some(20L), offset)
+    assertEquals(Optional.of(20L), offset)
 
     TestUtils.waitUntilTrue(() => isLeaderLocalOnBroker(topic, topicPartition.partition, broker),
       "Leader should be elected")
@@ -149,7 +149,7 @@ class LogOffsetTest extends BaseRequestTest {
     log.flush(false)
 
     val offset = log.fetchOffsetByTimestamp(ListOffsetsRequest.LATEST_TIMESTAMP).timestampAndOffsetOpt.map(_.offset)
-    assertEquals(Some(20L), offset)
+    assertEquals(Optional.of(20L), offset)
 
     TestUtils.waitUntilTrue(() => isLeaderLocalOnBroker(topic, 0, broker),
       "Leader should be elected")
@@ -219,7 +219,7 @@ class LogOffsetTest extends BaseRequestTest {
     log.flush(false)
 
     val offset = log.fetchOffsetByTimestamp(ListOffsetsRequest.EARLIEST_TIMESTAMP).timestampAndOffsetOpt.map(_.offset)
-    assertEquals(Some(0L), offset)
+    assertEquals(Optional.of(0L), offset)
 
     TestUtils.waitUntilTrue(() => isLeaderLocalOnBroker(topic, topicPartition.partition, broker),
       "Leader should be elected")