testcontainers-scala icon indicating copy to clipboard operation
testcontainers-scala copied to clipboard

How to make MySQLContainer and JdbcDatabaseDelegate work together?

Open yaohuacheng opened this issue 4 years ago • 1 comments

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[_]

yaohuacheng avatar Mar 02 '21 05:03 yaohuacheng

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.

tpetillot avatar Jun 08 '22 11:06 tpetillot