Class ResourceFile
java.lang.Object
org.springframework.aot.test.generate.file.DynamicFile
org.springframework.aot.test.generate.file.ResourceFile
- All Implemented Interfaces:
org.assertj.core.api.AssertProvider<ResourceFileAssert>
public final class ResourceFile
extends DynamicFile
implements org.assertj.core.api.AssertProvider<ResourceFileAssert>
DynamicFile
that holds resource file content and provides
ResourceFileAssert
support.- Since:
- 6.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static ResourceFile
of
(String path, CharSequence charSequence) Factory method to create a newResourceFile
from the givenCharSequence
.static ResourceFile
of
(String path, WritableContent writableContent) Factory method to create a newSourceFile
from the givenWritableContent
.static ResourceFile
of
(String path, InputStreamSource inputStreamSource) Factory method to create a newResourceFile
from the givenInputStreamSource
.Methods inherited from class org.springframework.aot.test.generate.file.DynamicFile
equals, getContent, getPath, hashCode, toString, toString
-
Method Details
-
of
Factory method to create a newResourceFile
from the givenCharSequence
.- Parameters:
path
- the relative path of the file ornull
to have the path deducedcharSequence
- a file containing the file contents- Returns:
- a
ResourceFile
instance
-
of
Factory method to create a newResourceFile
from the givenInputStreamSource
.- Parameters:
path
- the relative path of the fileinputStreamSource
- the source for the file- Returns:
- a
ResourceFile
instance
-
of
Factory method to create a newSourceFile
from the givenWritableContent
.- Parameters:
path
- the relative path of the filewritableContent
- the content to write to the file- Returns:
- a
ResourceFile
instance
-
assertThat
Deprecated.useassertThat(sourceFile)
rather than calling this method directly.AssertJassertThat
support.- Specified by:
assertThat
in interfaceorg.assertj.core.api.AssertProvider<ResourceFileAssert>
-
assertThat(sourceFile)
rather than calling this method directly.