How to make MySQLContainer and JdbcDatabaseDelegate work together?
yaohuacheng opened this issue · comments
yaohuacheng commented
I'm scala beginner.
when I use:
ScriptUtils.runInitScript(new JdbcDatabaseDelegate(mysqlContainer.container, ""), "sql/schema-notification.sql")
I encountered a error:
Type mismatch:
Required: JdbcDatabaseContainer[SELF] forSome {type SELF: JdbcDatabaseContainer[SELF] }
Found: MySQLContainer[_]
tpetillot commented
I've had to cast container into JdbcDatabaseContainer with wildcard:
container.container.asInstanceOf[org.testcontainers.containers.JdbcDatabaseContainer[_]]
Really weird that JdbcDatabaseDelegate
constructor take the raw type.