diff --git a/spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocations.java b/spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocations.java index 984d865a50..6e21b07845 100644 --- a/spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocations.java +++ b/spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,10 @@ public class RuntimeHintsInvocations implements AssertProvider appendable.append("test")); + assertThat(file).hasContent("test"); } } diff --git a/spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java b/spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java index 5280c9f795..488806af31 100644 --- a/spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java +++ b/spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,10 +106,9 @@ class SourceFileTests { } @Test - @SuppressWarnings("deprecation") - void assertThatReturnsAssert() { + void assertThatUseSourceFileAssert() { SourceFile sourceFile = SourceFile.of(HELLO_WORLD); - assertThat(sourceFile.assertThat()).isInstanceOf(SourceFileAssert.class); + assertThat(sourceFile).hasContent(HELLO_WORLD); } @Test