Consistent handling of AssertProvider implementations

This commit is contained in:
Stéphane Nicoll
2024-02-20 10:19:19 +01:00
parent 46bd133892
commit 06a39f166e
5 changed files with 18 additions and 20 deletions

View File

@@ -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.
@@ -42,10 +42,9 @@ class ResourceFileTests {
}
@Test
@SuppressWarnings("deprecation")
void assertThatReturnsResourceFileAssert() {
ResourceFile file = ResourceFile.of("path", "test");
assertThat(file.assertThat()).isInstanceOf(ResourceFileAssert.class);
void assertThatUsesResourceFileAssert() {
ResourceFile file = ResourceFile.of("path", appendable -> appendable.append("test"));
assertThat(file).hasContent("test");
}
}

View File

@@ -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