org.assertj.core.api.AbstractFileAssert.describedAs()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中org.assertj.core.api.AbstractFileAssert.describedAs()方法的一些代码示例,展示了AbstractFileAssert.describedAs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractFileAssert.describedAs()方法的具体详情如下:
包路径:org.assertj.core.api.AbstractFileAssert
类名称:AbstractFileAssert
方法名:describedAs

AbstractFileAssert.describedAs介绍

暂无

代码示例

代码示例来源:origin: apache/geode

assertThat(modulePath).describedAs("module path").isNotNull();

代码示例来源:origin: spring-io/initializr

/**
 * Validate that the project contains a base directory with the specified name.
 * <p>
 * When extracting such archive, a directory with the specified {@code name} will be
 * created with the content of the project instead of extracting it in the directory
 * itself.
 * @param name the expected name of the base directory
 * @return an updated project assert on that base directory
 */
public ProjectAssert hasBaseDir(String name) {
  File projectDir = file(name);
  assertThat(projectDir).describedAs("No directory %s found in %s", name,
      this.dir.getAbsolutePath()).exists();
  assertThat(projectDir).isDirectory();
  // Replacing the root dir so that other assertions match the root
  return new ProjectAssert(projectDir);
}

相关文章