Class ResourceFile

java.lang.Object
org.springframework.aot.test.generator.file.DynamicFile
org.springframework.aot.test.generator.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 Details

    • of

      public static ResourceFile of(String path, CharSequence charSequence)
      Factory method to create a new ResourceFile from the given CharSequence.
      Parameters:
      path - the relative path of the file or null to have the path deduced
      charSequence - a file containing the source contents
      Returns:
      a ResourceFile instance
    • of

      public static ResourceFile of(String path, WritableContent writableContent)
      Factory method to create a new SourceFile from the given WritableContent.
      Parameters:
      path - the relative path of the file or null to have the path deduced
      writableContent - the content to write to the file
      Returns:
      a SourceFile instance
    • assertThat

      @Deprecated public ResourceFileAssert assertThat()
      Deprecated.
      use assertThat(sourceFile) rather than calling this method directly.
      AssertJ assertThat support.
      Specified by:
      assertThat in interface org.assertj.core.api.AssertProvider<ResourceFileAssert>