Replace junit-dataprovider with junit-jupiter-params#1655
Conversation
| @Rule | ||
| public final ArchConfigurationRule configurationRule = new ArchConfigurationRule(); | ||
| @RegisterExtension | ||
| ArchConfigurationExtension archConfiguration = new ArchConfigurationExtension(); |
There was a problem hiding this comment.
optional: include in the commit message the migration ArchConfigurationRule -> ArchConfigurationExtension
I know that it must be done because of junit4 ->junit5 but I think it wouldn't hurt to make it explicit
you even created that Extension in this commit! 🙂
I think that's worth a mention
| import org.junit.rules.ExternalResource; | ||
|
|
||
| /** | ||
| * @deprecated use JUnit 5 and {@link ArchConfigurationExtension} instead |
There was a problem hiding this comment.
Is it feasible to entirely remove this Rule?
I might give it a try later, there seem to be only 25 tests left
There was a problem hiding this comment.
It is certainly possible.
It would just be unrelated to the goal Replace junit-dataprovider with junit-jupiter-params.
There was a problem hiding this comment.
then we'll do it in another PR.
maybe one to get rid of junit4 for the tests for archunit entirely. let's see when we have how much time.
There haven't been any Techdays for me for some time
| @@ -56,7 +56,7 @@ public void locations_of_packages_within_JAR_URIs() throws Exception { | |||
| Set<Location> locations = Locations.ofPackage("org.junit"); | |||
There was a problem hiding this comment.
if you replace this string by org.junit.jupiter.api you can replace org.junit.Test.class by Test.class
I see no reason to use the junit4 variant of it.
let's break that dependency (there are 3 more usages in this class of the class literal)
There was a problem hiding this comment.
I didn't want the commit migrate ClassFileImporterTest to junit-jupiter-params to change any test logic.
Changing org.junit.Test to org.junit.jupiter.api.Test would perfectly fit in a PR whose goal is to get rid of JUnit 4, but is irrelevant for the goal to eliminate the junit-dataprovider.
StefanGraeber
left a comment
There was a problem hiding this comment.
LGTM but you lost a commit gin-off ;)
also don't forget to squash the fixup commits
…nit-dataprovider dependency Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
…Value}Source
Note that
> By default, `@CsvSource` uses a single quote (') as its quote character [...]
> An empty, quoted value ('') results in an empty String [...]
> whereas an entirely empty value is interpreted as a null reference.
[https://junit.org/junit5/docs/current/api/org.junit.jupiter.params/org/junit/jupiter/params/provider/CsvSource.html]
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Stefan Gräber <stefan.graeber@tngtech.com> Co-authored-by: Manfred Hanke <manfred.hanke@tngtech.com> Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
…dSource For convenience (and to keep the diff smaller) `com.tngtech.archunit.testutil.DataProviders.$` provides the same API for `junit-jupiter-params` as `com.tngtech.java.junit.dataprovider.DataProviders.$` did for `junit-dataprovider`. Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
…it-jupiter-params Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
…unit-jupiter-params introducing `ArchConfigurationExtension` Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
replacing the JUnit 4 `@Rule`s with JUnit Jupiter extensions (`ContextClassLoaderExtension`, `LogTestExtension`, `OutsideOfClassPathExtension`, `ReplaceFileExtension`, `SystemPropertiesExtension`) and also converting some other tests that made use of the same `TestRule`s to JUnit 5 to eliminate some of these custom `TestRule`s already (`LogTestRule`, `OutsideOfClassPathRule`, `ReplaceFileRule`) Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
…piter-params Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Stefan Gräber <stefan.graeber@tngtech.com>
c4c9eb3 to
ca4035c
Compare
Resolves #1471