Skip to content

fix: Removed dependency to Junit4 #777

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions applications/spring-shell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.junit.rules;

/**
* "Fake" class used as a replacement for Junit4-dependent classes.
* See more at: <a href="https://github.com/testcontainers/testcontainers-java/issues/970">
* GenericContainer run from Jupiter tests shouldn't require JUnit 4.x library on runtime classpath
* </a>.
*/
public class ExternalResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.junit.rules;

/**
* "Fake" class used as a replacement for Junit4-dependent classes.
* See more at: <a href="https://github.com/testcontainers/testcontainers-java/issues/970">
* GenericContainer run from Jupiter tests shouldn't require JUnit 4.x library on runtime classpath
* </a>.
*/
@SuppressWarnings("unused")
public class Statement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.junit.rules;

/**
* "Fake" class used as a replacement for Junit4-dependent classes.
* See more at: <a href="https://github.com/testcontainers/testcontainers-java/issues/970">
* GenericContainer run from Jupiter tests shouldn't require JUnit 4.x library on runtime classpath
* </a>.
*/
@SuppressWarnings("unused")
public interface TestRule {
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

/**
* Base class to be extended by integrationTests.
Expand Down Expand Up @@ -236,16 +236,16 @@ protected void executeMavenGoals(Path executionDir, String... goals) {
CommandLineException executionException = invocationResult.getExecutionException();
int exitCode = invocationResult.getExitCode();
if (executionException != null) {
Assert.fail("Maven build 'mvn " + g
fail("Maven build 'mvn " + g
+ " " + pomXml + " "
+ "' failed with Exception: " + executionException.getMessage());
}
if (exitCode != 0) {
Assert.fail("Maven build 'mvn " + g
fail("Maven build 'mvn " + g
+ "' failed with exitCode: " + exitCode);
}
} catch (MavenInvocationException e) {
Assert.fail("Maven build 'mvn " + g
fail("Maven build 'mvn " + g
+ " " + pomXml + " "
+ "' failed with Exception: " + e.getMessage());
e.printStackTrace();
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand Down