From ed0d3d9b2a5c352e679e6190827234b8b2748086 Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Tue, 17 Sep 2024 11:39:53 -0700 Subject: [PATCH] Fix broken UT Signed-off-by: Chen Dai --- .../flint/spark/FlintSparkTransactionSupportSuite.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flint-spark-integration/src/test/scala/org/opensearch/flint/spark/FlintSparkTransactionSupportSuite.scala b/flint-spark-integration/src/test/scala/org/opensearch/flint/spark/FlintSparkTransactionSupportSuite.scala index 9be1e6472..93a7a8bce 100644 --- a/flint-spark-integration/src/test/scala/org/opensearch/flint/spark/FlintSparkTransactionSupportSuite.scala +++ b/flint-spark-integration/src/test/scala/org/opensearch/flint/spark/FlintSparkTransactionSupportSuite.scala @@ -32,8 +32,11 @@ class FlintSparkTransactionSupportSuite extends FlintSuite with Matchers { override protected def beforeEach(): Unit = { super.beforeEach() + + val logEntry = mock[FlintMetadataLog[FlintMetadataLogEntry]] + when(logEntry.getLatest).thenReturn(Optional.of(mock[FlintMetadataLogEntry])) when(mockFlintMetadataLogService.getIndexMetadataLog(testIndex)) - .thenReturn(Optional.of(mock[FlintMetadataLog[FlintMetadataLogEntry]])) + .thenReturn(Optional.of(logEntry)) } override protected def afterEach(): Unit = {