diff --git a/buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java b/buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java index d9c70b2b031a..1294d6192975 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java @@ -46,7 +46,7 @@ class ArchitectureCheckTests { void whenPackagesAreTangledTaskFailsAndWritesAReport() throws Exception { prepareTask("tangled", (architectureCheck) -> { assertThatExceptionOfType(GradleException.class).isThrownBy(architectureCheck::checkArchitecture); - assertThat(failureReport(architectureCheck).length()).isGreaterThan(0); + assertThat(failureReport(architectureCheck)).isNotEmpty(); }); } @@ -54,7 +54,7 @@ void whenPackagesAreTangledTaskFailsAndWritesAReport() throws Exception { void whenPackagesAreNotTangledTaskSucceedsAndWritesAnEmptyReport() throws Exception { prepareTask("untangled", (architectureCheck) -> { architectureCheck.checkArchitecture(); - assertThat(failureReport(architectureCheck).length()).isZero(); + assertThat(failureReport(architectureCheck)).isEmpty(); }); } @@ -66,7 +66,7 @@ File failureReport(ArchitectureCheck architectureCheck) { void whenBeanPostProcessorBeanMethodIsNotStaticTaskFailsAndWritesAReport() throws Exception { prepareTask("bpp/nonstatic", (architectureCheck) -> { assertThatExceptionOfType(GradleException.class).isThrownBy(architectureCheck::checkArchitecture); - assertThat(failureReport(architectureCheck).length()).isGreaterThan(0); + assertThat(failureReport(architectureCheck)).isNotEmpty(); }); } @@ -74,7 +74,7 @@ void whenBeanPostProcessorBeanMethodIsNotStaticTaskFailsAndWritesAReport() throw void whenBeanPostProcessorBeanMethodIsStaticAndHasUnsafeParametersTaskFailsAndWritesAReport() throws Exception { prepareTask("bpp/unsafeparameters", (architectureCheck) -> { assertThatExceptionOfType(GradleException.class).isThrownBy(architectureCheck::checkArchitecture); - assertThat(failureReport(architectureCheck).length()).isGreaterThan(0); + assertThat(failureReport(architectureCheck)).isNotEmpty(); }); } @@ -83,7 +83,7 @@ void whenBeanPostProcessorBeanMethodIsStaticAndHasSafeParametersTaskSucceedsAndW throws Exception { prepareTask("bpp/safeparameters", (architectureCheck) -> { architectureCheck.checkArchitecture(); - assertThat(failureReport(architectureCheck).length()).isZero(); + assertThat(failureReport(architectureCheck)).isEmpty(); }); } @@ -92,7 +92,7 @@ void whenBeanPostProcessorBeanMethodIsStaticAndHasNoParametersTaskSucceedsAndWri throws Exception { prepareTask("bpp/noparameters", (architectureCheck) -> { architectureCheck.checkArchitecture(); - assertThat(failureReport(architectureCheck).length()).isZero(); + assertThat(failureReport(architectureCheck)).isEmpty(); }); } @@ -100,7 +100,7 @@ void whenBeanPostProcessorBeanMethodIsStaticAndHasNoParametersTaskSucceedsAndWri void whenBeanFactoryPostProcessorBeanMethodIsNotStaticTaskFailsAndWritesAReport() throws Exception { prepareTask("bfpp/nonstatic", (architectureCheck) -> { assertThatExceptionOfType(GradleException.class).isThrownBy(architectureCheck::checkArchitecture); - assertThat(failureReport(architectureCheck).length()).isGreaterThan(0); + assertThat(failureReport(architectureCheck)).isNotEmpty(); }); } @@ -108,7 +108,7 @@ void whenBeanFactoryPostProcessorBeanMethodIsNotStaticTaskFailsAndWritesAReport( void whenBeanFactoryPostProcessorBeanMethodIsStaticAndHasParametersTaskFailsAndWritesAReport() throws Exception { prepareTask("bfpp/parameters", (architectureCheck) -> { assertThatExceptionOfType(GradleException.class).isThrownBy(architectureCheck::checkArchitecture); - assertThat(failureReport(architectureCheck).length()).isGreaterThan(0); + assertThat(failureReport(architectureCheck)).isNotEmpty(); }); } @@ -117,7 +117,7 @@ void whenBeanFactoryPostProcessorBeanMethodIsStaticAndHasNoParametersTaskSucceed throws Exception { prepareTask("bfpp/noparameters", (architectureCheck) -> { architectureCheck.checkArchitecture(); - assertThat(failureReport(architectureCheck).length()).isZero(); + assertThat(failureReport(architectureCheck)).isEmpty(); }); } diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/ReleaseScheduleTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/ReleaseScheduleTests.java index f4718e62f075..bbf78521403c 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/ReleaseScheduleTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/ReleaseScheduleTests.java @@ -37,7 +37,7 @@ * * @author Andy Wilkinson */ -public class ReleaseScheduleTests { +class ReleaseScheduleTests { private final RestTemplate rest = new RestTemplate(); diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionUpgradeTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionUpgradeTests.java index 7220de730d01..404ae42fe89f 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionUpgradeTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionUpgradeTests.java @@ -40,7 +40,7 @@ * * @author Andy Wilkinson */ -public class DependencyVersionUpgradeTests { +class DependencyVersionUpgradeTests { @ParameterizedTest @ArtifactVersion(current = "1.2.3", candidate = "1.2.3") @@ -244,7 +244,7 @@ void isUpgradeWhenReleaseTrainToSnapshotAndMovingToSnapshotsShouldReturnTrue(Dep static class InputProvider implements ArgumentsProvider { @Override - public Stream provideArguments(ExtensionContext context) throws Exception { + public Stream provideArguments(ExtensionContext context) { Method testMethod = context.getRequiredTestMethod(); Stream artifactVersions = artifactVersions(testMethod) .map((artifactVersion) -> Arguments.of(VersionType.ARTIFACT_VERSION.parse(artifactVersion.current()),