Skip to content

Running TestContainers outside of Junit context #2247

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

Closed
imochurad opened this issue Jan 13, 2020 · 2 comments
Closed

Running TestContainers outside of Junit context #2247

imochurad opened this issue Jan 13, 2020 · 2 comments

Comments

@imochurad
Copy link

This is more a question than an issue:
I would like to use TestContainers also when I start my app in local environment via IDE or by running a jar directly. I would like to start a container (ElasticSearch) and let my app rely on it. So that I do not have to deploy locally ElasticSearch cluster.
But TestContainers are tightly coupled with JUnit. I think this coupling is not necessary.
Thoughts?

@bsideup
Copy link
Member

bsideup commented Jan 13, 2020

But TestContainers are tightly coupled with JUnit

It is not. There is built-in support for JUnit Rules (hence strict dependency on junit4, to be removed soon) but it only calls methods of Startable (read: .start() and .stop()/.close()) and, if implemented, TestLifecycleAware.

That said, Testcontainers 2.0 will ship a real "core" module that does not depend on any testing framework, and the integrations will be implemented as modules (in the same manner as JUnit 5 / Spock / ScalaTest support is implemented ATM)

@bsideup
Copy link
Member

bsideup commented Jan 13, 2020

See #970 for more details.

I will close this question since it duplicates the previous ones from the 2.0 milestone.

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

No branches or pull requests

2 participants