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

JerseyTest is not compatible with JUnit 5 #4824

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

jbescos
Copy link
Member

@jbescos jbescos commented Jul 12, 2021

Relates to issue #3662

This PR allows to run tests with JUnit5. The methods JerseyTest#setUp and JerseyTest#tearDown are invoked in the same way they are with JUnit4. Then, no NullPointerException is thrown.

This PR is unrelated to JUnit5 extensions.

Dependency tree of the test module (junit4 is not a dependency):

[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ jersey-3662 ---
[INFO] org.glassfish.jersey.tests.integration:jersey-3662:jar:2.35-SNAPSHOT
[INFO] +- org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:jar:2.35-SNAPSHOT:compile
[INFO] |  +- jakarta.servlet:jakarta.servlet-api:jar:4.0.3:compile
[INFO] |  +- org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.35-SNAPSHOT:compile
[INFO] |  |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-server:jar:2.35-SNAPSHOT:compile
[INFO] |  |  |  +- org.glassfish.jersey.core:jersey-client:jar:2.35-SNAPSHOT:compile
[INFO] |  |  |  \- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |  |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.35-SNAPSHOT:compile
[INFO] |  |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.35-SNAPSHOT:compile
[INFO] |  +- org.glassfish.jersey.containers:jersey-container-grizzly2-http:jar:2.35-SNAPSHOT:compile
[INFO] |  |  +- org.glassfish.hk2.external:jakarta.inject:jar:2.6.1:compile
[INFO] |  |  +- org.glassfish.grizzly:grizzly-http-server:jar:2.4.4:compile
[INFO] |  |  |  \- org.glassfish.grizzly:grizzly-http:jar:2.4.4:compile
[INFO] |  |  |     \- org.glassfish.grizzly:grizzly-framework:jar:2.4.4:compile
[INFO] |  |  \- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile
[INFO] |  \- org.glassfish.jersey.containers:jersey-container-grizzly2-servlet:jar:2.35-SNAPSHOT:compile
[INFO] |     +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.35-SNAPSHOT:compile
[INFO] |     \- org.glassfish.grizzly:grizzly-http-servlet:jar:2.4.4:compile
[INFO] +- org.junit.jupiter:junit-jupiter:jar:5.6.0:test
[INFO] |  +- org.junit.jupiter:junit-jupiter-api:jar:5.6.0:test
[INFO] |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  \- org.junit.platform:junit-platform-commons:jar:1.6.0:test
[INFO] |  +- org.junit.jupiter:junit-jupiter-params:jar:5.6.0:test
[INFO] |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.6.0:test
[INFO] |     \- org.junit.platform:junit-platform-engine:jar:1.6.0:test
[INFO] \- org.glassfish.jersey.inject:jersey-hk2:jar:2.35-SNAPSHOT:compile
[INFO]    +- org.glassfish.jersey.core:jersey-common:jar:2.35-SNAPSHOT:compile
[INFO]    |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO]    |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO]    +- org.glassfish.hk2:hk2-locator:jar:2.6.1:compile
[INFO]    |  +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.6.1:compile
[INFO]    |  +- org.glassfish.hk2:hk2-api:jar:2.6.1:compile
[INFO]    |  \- org.glassfish.hk2:hk2-utils:jar:2.6.1:compile
[INFO]    \- org.javassist:javassist:jar:3.25.0-GA:compile

@senivam
Copy link
Contributor

senivam commented Jul 19, 2021

CQ# 23617 resolved

Copy link
Contributor

@senivam senivam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jansupol jansupol merged commit 3d131db into eclipse-ee4j:master Sep 2, 2021
@senivam senivam added this to the 2.35 milestone Sep 6, 2021
This was referenced Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants