Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshj1703 committed Nov 21, 2023
1 parent 9fdc1d6 commit acf613a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ public void testNoRecordKeyFieldProp(boolean useKeyGeneratorClassName) {
if (useKeyGeneratorClassName) {
// "Property hoodie.datasource.write.recordkey.field not found" exception cause CustomKeyGenerator init fail
Assertions.assertTrue(e.getMessage()
.contains("Property hoodie.datasource.write.recordkey.field not found"));
.contains("Unable to find field names for record key in cfg"));
} else {
Assertions.assertTrue(stackTraceToString(e).contains("Property hoodie.datasource.write.recordkey.field not found"));
Assertions.assertTrue(stackTraceToString(e).contains("Unable to find field names for record key in cfg"));
}

}
Expand All @@ -280,9 +280,9 @@ public void testNoRecordKeyFieldProp(boolean useKeyGeneratorClassName) {
if (useKeyGeneratorClassName) {
// "Property hoodie.datasource.write.recordkey.field not found" exception cause CustomKeyGenerator init fail
Assertions.assertTrue(e.getMessage()
.contains("Property hoodie.datasource.write.recordkey.field not found"));
.contains("All of the values for ([]) were either null or empty"));
} else {
Assertions.assertTrue(stackTraceToString(e).contains("Property hoodie.datasource.write.recordkey.field not found"));
Assertions.assertTrue(stackTraceToString(e).contains("All of the values for ([]) were either null or empty"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import org.junit.jupiter.api.{AfterEach, BeforeEach, Disabled, Test}
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.{CsvSource, EnumSource, ValueSource}

import java.lang.reflect.InvocationTargetException
import java.sql.{Date, Timestamp}
import java.util.concurrent.{CountDownLatch, TimeUnit}
import java.util.function.Consumer
Expand Down Expand Up @@ -1003,7 +1002,7 @@ class TestCOWDataSource extends HoodieSparkClientTestBase with ScalaAssertionSup
fail("should fail when invalid PartitionKeyType is provided!")
} catch {
case e: Exception =>
assertTrue(e.getCause.getCause.asInstanceOf[InvocationTargetException].getTargetException.getMessage.contains("No enum constant org.apache.hudi.keygen.CustomAvroKeyGenerator.PartitionKeyType.DUMMY"))
assertTrue(e.getCause.getMessage.contains("No enum constant org.apache.hudi.keygen.CustomAvroKeyGenerator.PartitionKeyType.DUMMY"))
}
}

Expand Down

0 comments on commit acf613a

Please sign in to comment.