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

OracleContainer extends JdbcDatabaseContainer without generic type #1423

Closed
el-dot opened this issue Apr 25, 2019 · 4 comments · Fixed by #1425
Closed

OracleContainer extends JdbcDatabaseContainer without generic type #1423

el-dot opened this issue Apr 25, 2019 · 4 comments · Fixed by #1425

Comments

@el-dot
Copy link

el-dot commented Apr 25, 2019

It means I need explicit cast when using methods from super type, eg:

@ClassRule
public static OracleContainer db = (OracleContainer) new OracleContainer("foo")
        .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("db container logger")));

Following screams compilation errors, because #withLogConsumer returns GenericContainer:

@ClassRule
public static OracleContainer db = new OracleContainer("foo")
        .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("db container logger")));
@el-dot el-dot changed the title OracleContainer extends JdbcDatabaseContainer without genneric type for test OracleContainer extends JdbcDatabaseContainer without generic type Apr 25, 2019
@bsideup
Copy link
Member

bsideup commented Apr 25, 2019

Hi @SoftwareTipi,

Have you tried public static OracleContainer db = new OracleContainer<>("foo") as a workaround?

@el-dot
Copy link
Author

el-dot commented Apr 25, 2019

Hi OracleContainer does not have generic type on itself so diamond syntax won't apply to this.
And still this would be workaround.

@kiview
Copy link
Member

kiview commented Apr 26, 2019

@SoftwareTipi Yes, you are right. Are you interested in providing a PR?

@bsideup
Copy link
Member

bsideup commented Apr 26, 2019

@kiview already submitted: #1425

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

Successfully merging a pull request may close this issue.

3 participants