From 71f7cc85e6b1ce18401d55e4a1c0d36bed1cbb84 Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Tue, 19 Mar 2024 14:39:04 -0700 Subject: [PATCH] Update test expectations --- .../gradle/spring/UpdateGradleTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/testWithSpringBoot_2_7/java/org/openrewrite/gradle/spring/UpdateGradleTest.java b/src/testWithSpringBoot_2_7/java/org/openrewrite/gradle/spring/UpdateGradleTest.java index 65177bc72..bf838f0f4 100644 --- a/src/testWithSpringBoot_2_7/java/org/openrewrite/gradle/spring/UpdateGradleTest.java +++ b/src/testWithSpringBoot_2_7/java/org/openrewrite/gradle/spring/UpdateGradleTest.java @@ -16,6 +16,7 @@ package org.openrewrite.gradle.spring; import org.junit.jupiter.api.Test; +import org.openrewrite.FileAttributes; import org.openrewrite.Tree; import org.openrewrite.config.Environment; import org.openrewrite.marker.BuildTool; @@ -80,6 +81,9 @@ void upgradeGradleWrapperAndPlugins() { dependencies { implementation "org.springframework.boot:spring-boot-starter-web" } + tasks.withType(Test).configureEach { + useJUnitPlatform() + } """.formatted(version.group()); }) //language=gradle @@ -111,7 +115,9 @@ void upgradeGradleWrapperAndPlugins() { assertThat(after).isNotBlank(); return after + "\n"; }).afterRecipe(gradlew -> { - assertThat(gradlew.getFileAttributes().isReadable()).isTrue(); + assertThat(gradlew.getFileAttributes()) + .isNotNull() + .matches(FileAttributes::isReadable); assertThat(gradlew.getFileAttributes().isExecutable()).isTrue(); }) ), @@ -167,6 +173,9 @@ implementation platform("org.springframework.boot:spring-boot-dependencies:2.6.1 implementation platform("org.springframework.boot:spring-boot-dependencies:%s") implementation "org.springframework.boot:spring-boot-starter-web" } + tasks.withType(Test).configureEach { + useJUnitPlatform() + } """.formatted(version.group(), version.group()); }) ), @@ -197,7 +206,8 @@ implementation platform("org.springframework.boot:spring-boot-dependencies:%s") assertThat(after).isNotBlank(); return after + "\n"; }).afterRecipe(gradlew -> { - assertThat(gradlew.getFileAttributes().isReadable()).isTrue(); + assertThat(gradlew.getFileAttributes()).isNotNull() + .matches(FileAttributes::isReadable); assertThat(gradlew.getFileAttributes().isExecutable()).isTrue(); }) ),