-
Notifications
You must be signed in to change notification settings - Fork 81
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
[SHRINKRES-342] Migrate to JUnit5 #241
Conversation
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import org.junit.jupiter.api.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wildcard imports please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have missed that. All the occurrences should be fixed.
52fb084
to
ce0b3c3
Compare
@@ -1,19 +1,3 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not intentional, probably some random input from my keyboard... Thanks for noticing it.
System.setProperty(MavenSettingsBuilder.ALT_MAVEN_OFFLINE, "true"); | ||
@Test | ||
void overrideOfflineFlag() { | ||
System.setProperty(MavenSettingsBuilder.ALT_MAVEN_OFFLINE, "true"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I see in this change is that in case of a test failure the property is still set and might affect other tests either in this testsuite or somewhere else (as it's a system property). I'd propose to change this testsuite in this PR and create a proper cleanup method AfterEach
Assertions.assertThrows(NoResolvedResultException.class, () -> { | ||
Maven.configureResolver().fromFile("target/settings/profiles/settings-jetty.xml") | ||
.resolve("junit:junit:3.8.2").withTransitivity().as(File.class); | ||
Assertions.fail("Artifact junit:junit:3.8.2 should not be present in local repository"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this Assertions.fail redundant?
pom.xml
Outdated
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest</artifactId> | ||
<version>2.2</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Hamcrest released a new version 3.0, can that be used?
Good job @xjusko , just a couple of things I noticed and one rebase and I believe we can merge this |
a72907e
to
d619cb6
Compare
d619cb6
to
9fc0cf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx @xjusko
https://issues.redhat.com/browse/SHRINKRES-342