Skip to content

Commit

Permalink
Suggest putting jupiter on runtime only (#2021)
Browse files Browse the repository at this point in the history
Suggest putting jupiter on runtime only in error
  • Loading branch information
jakobjuelich authored Jan 11, 2022
1 parent c33a21c commit 397a423
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-2021.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Upon missing jupiter on classpath, suggest putting it on runtime rather
than implementation to avoid making checkUnusedDependenciesTest fail in return.
links:
- https://github.com/palantir/gradle-baseline/pull/2021
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void validateSourceSet(SourceSet ss, Test task) {
// org.junit.jupiter.api.Test annotation, but as JUnit4 knows nothing about these, they'll silently not run
// unless the user has wired up the dependency correctly.
if (sourceSetMentionsJUnit5Api(ss)) {
String implementation = ss.getImplementationConfigurationName();
String runtime = ss.getRuntimeClasspathConfigurationName();
Preconditions.checkState(
junitPlatformEnabled,
"Some tests mention JUnit5, but the '"
Expand All @@ -102,7 +102,7 @@ private void validateSourceSet(SourceSet ss, Test task) {
+ "useJUnitPlatform() enabled. This means tests may be silently not running! Please "
+ "add the following:\n\n"
+ " "
+ implementation
+ runtime
+ " 'org.junit.jupiter:junit-jupiter'\n");
}

Expand Down

0 comments on commit 397a423

Please sign in to comment.