diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt index e5090ad883..6bac637f11 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.com.intellij.lang.ASTNode import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicInteger +import java.util.function.Consumer internal const val TEST_FILE_NAME = "TestFileName.kt" @@ -38,8 +39,8 @@ typealias LintErrorCallback = (LintError, Boolean) -> Unit internal fun List.assertEquals(vararg expectedLintErrors: LintError) { if (size == expectedLintErrors.size) { Assertions.assertThat(this) - .allSatisfy { actual -> - val expected = expectedLintErrors[this.indexOf(actual)] + .allSatisfy(Consumer { actual -> + val expected = expectedLintErrors[this@assertEquals.indexOf(actual)] SoftAssertions.assertSoftly { sa -> sa .assertThat(actual.line) @@ -62,7 +63,7 @@ internal fun List.assertEquals(vararg expectedLintErrors: LintError) .`as`("Can be autocorrected") .isEqualTo(expected.canBeAutoCorrected) } - } + }) } else { Assertions.assertThat(this).containsExactly(*expectedLintErrors) } diff --git a/pom.xml b/pom.xml index 3903024b77..987f029201 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ org.assertj assertj-core - 3.20.2 + 3.21.0 org.mockito