Skip to content

Update to AssertJ 4.0 #4653

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions documentation/documentation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ val jdkJavadocBaseUrl = "https://docs.oracle.com/en/java/javase/${JavaVersion.cu
val elementListsDir = layout.buildDirectory.dir("elementLists")
val externalModulesWithoutModularJavadoc = mapOf(
"org.apiguardian.api" to "https://apiguardian-team.github.io/apiguardian/docs/$apiGuardianDocVersion/api/",
"org.assertj.core" to "https://javadoc.io/doc/org.assertj/assertj-core/${libs.versions.assertj.get()}/",
"org.opentest4j" to "https://ota4j-team.github.io/opentest4j/docs/$ota4jDocVersion/api/"
"org.opentest4j" to "https://ota4j-team.github.io/opentest4j/docs/1.3.0/api/",
)
require(externalModulesWithoutModularJavadoc.values.all { it.endsWith("/") }) {
"all base URLs must end with a trailing slash: $externalModulesWithoutModularJavadoc"
Expand Down Expand Up @@ -419,6 +418,10 @@ tasks {

links(jdkJavadocBaseUrl)
links("https://junit.org/junit4/javadoc/${libs.versions.junit4.get()}/")
val assertJVersion = libs.versions.assertj.get()
if (!assertJVersion.endsWith("-SNAPSHOT")) {
links("https://javadoc.io/doc/org.assertj/assertj-core/$assertJVersion/")
}
externalModulesWithoutModularJavadoc.forEach { (moduleName, baseUrl) ->
linksOffline(baseUrl, elementListsDir.get().asFile.resolve(moduleName).absolutePath)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ant = "1.10.15"
apiguardian = "1.1.2"
asciidoctorj-pdf = "2.3.19"
asciidoctor-plugins = "4.0.4" # Check if workaround in documentation.gradle.kts can be removed when upgrading
assertj = "3.27.3"
assertj = "4.0.0-SNAPSHOT"
bnd = "7.1.0"
checkstyle = "11.0.0"
eclipse = "4.36.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void reportTypeMismatchBetweenParameterAndResolvedParameterWithArrayTypes() {

assertThatExceptionOfType(ParameterResolutionException.class)//
.isThrownBy(this::resolveMethodParameters)//
.withMessageContaining(//
.withMessageContainingAll(//
"resolved a value of type [int[][]] for parameter [java.lang.String[]", //
"in method", //
"but a value assignment compatible with [java.lang.String[]] is required." //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ void reportsEngineExecutionFailureOnUnresolvedUniqueIdSelectorWithEnginePrefix()
.isInstanceOf(DiscoveryIssueException.class) //
.hasMessageStartingWith(
"TestEngine with ID 'some-engine' encountered a critical issue during test discovery") //
.hasMessageContaining("(1) [ERROR] %s could not be resolved", selector);
.hasMessageContaining("(1) [ERROR] %s could not be resolved".formatted(selector));
}

@Test
Expand All @@ -877,7 +877,7 @@ void reportsEngineExecutionFailureForSelectorResolutionFailure() {
.isInstanceOf(DiscoveryIssueException.class) //
.hasMessageStartingWith(
"TestEngine with ID 'some-engine' encountered a critical issue during test discovery") //
.hasMessageContaining("(1) [ERROR] %s resolution failed", selector) //
.hasMessageContaining("(1) [ERROR] %s resolution failed".formatted(selector)) //
.hasMessageContaining("Cause: java.lang.RuntimeException: boom");
}

Expand Down
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ plugins {
dependencyResolutionManagement {
repositories {
mavenCentral()
maven(url = "https://central.sonatype.com/repository/maven-snapshots/") {
mavenContent {
snapshotsOnly()
}
}
}
repositoriesMode = FAIL_ON_PROJECT_REPOS
}
Expand Down
Loading