Skip to content

Commit

Permalink
bulk-cdk-toolkits-extract-jdbc: noop JdbcCheckQueries when no queries…
Browse files Browse the repository at this point in the history
… defined (#44842)
  • Loading branch information
postamar authored Sep 3, 2024
1 parent f85baeb commit be6b5ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const val CHECK_QUERIES_PREFIX = "airbyte.connector.check.jdbc"
class JdbcCheckQueries {

// Micronaut configuration objects work better with mutable properties.
lateinit var queries: List<String>
protected var queries: List<String> = emptyList()

private val log = KotlinLogging.logger {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class JdbcCheckQueriesTest {

@Inject lateinit var checkQueries: JdbcCheckQueries

@Test
fun testEmpty() {
val empty = JdbcCheckQueries()
Assertions.assertDoesNotThrow { h2.createConnection().use { empty.executeAll(it) } }
}

@Test
@Property(name = "$Q[0]", value = "SELECT DATABASE_PATH() FROM DUAL")
fun testPass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class JdbcMetadataQuerierTest {
JdbcMetadataQuerier.Factory(
selectQueryGenerator = H2SourceOperations(),
fieldTypeMapper = H2SourceOperations(),
checkQueries = JdbcCheckQueries().apply { queries = listOf() },
checkQueries = JdbcCheckQueries(),
constants = DefaultJdbcConstants(),
)

Expand Down

0 comments on commit be6b5ef

Please sign in to comment.