Skip to content

Commit

Permalink
fix: Removed dependency to Junit4 (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonsadowski3 authored Apr 27, 2023
1 parent 97ebc70 commit 8c0e880
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 4 deletions.
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

0 comments on commit 8c0e880

Please sign in to comment.