Skip to content

[Bug]: TestContainers cannot be used without JUnit4 dependency #7434

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
asolntsev opened this issue Aug 22, 2023 · 1 comment
Closed

[Bug]: TestContainers cannot be used without JUnit4 dependency #7434

asolntsev opened this issue Aug 22, 2023 · 1 comment
Labels

Comments

@asolntsev
Copy link

Module

Core

Testcontainers version

1.19.0

Using the latest Testcontainers version?

Yes

Host OS

doesn't matter

Host Arch

doesn't matter

Docker version

doesn't matter

What happened?

I want to use TestContainers in a project with JUnit 5.
I want to exclude JUnit 4 dependency to avoid the risk that some of our developers occasionally use wrong annotations.

dependencies {
  testImplementation("org.testcontainers:junit-jupiter:1.19.0") { exclude group: 'junit' }
  testImplementation("org.testcontainers:selenium:1.19.0") { exclude group: 'junit' }
}

But my project doesn't even compile without JUnit 4.

Relevant log output

> Task :compileTestJava FAILED
/Users/andrei/projects/selenide-examples/testcontainers/src/test/java/org/selenide/examples/SearchTestWithDocker.java:31: error: cannot access TestRule
      .withRecordingMode(RECORD_ALL, new File("build"))
      ^
  class file for org.junit.rules.TestRule not found

Additional Information

No response

@eddumelendez
Copy link
Member

Duplicated of #970

@eddumelendez eddumelendez closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants