Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make MySQLContainer and JdbcDatabaseDelegate work together? #167

Open
yaohuacheng opened this issue Mar 2, 2021 · 1 comment
Open

Comments

@yaohuacheng
Copy link

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
Copy link

tpetillot commented Jun 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants