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

x33g5p2x  于2022-01-16 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(61)

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

AbstractPathAssert.isNotNull介绍

暂无

代码示例

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

@Test
 public void writerReturnsPathIfWritten() throws Exception {
  writer.startFile("server-1");
  EntryEvent event = mock(EntryEvent.class);
  when(event.getNewValue()).thenReturn(new byte[] {});
  writer.beforeCreate(event);
  assertThat(writer.endFile()).isNotNull();
 }
}

代码示例来源:origin: de.pfabulist.lindwurm/niotest

@Test
public void testGetParentOfLongerRelativeNameIsNotNull() throws Exception {
  assertThat( relAB().getParent() ).isNotNull();
}

代码示例来源:origin: cdancy/bitbucket-rest

/**
 * Generate a dummy file at the `baseDir` location.
 *
 * @param baseDir directory to generate the file under.
 * @return Path pointing at generated file.
 * @throws Exception if file could not be written.
 */
public static Path initGeneratedFile(final Path baseDir) throws Exception {
  assertThat(baseDir).isNotNull();
  assertThat(baseDir.toFile().isDirectory()).isTrue();
  final String randomName = randomString();
  final List<String> lines = Arrays.asList(randomName);
  final Path file = Paths.get(new File(baseDir.toFile(), randomName + ".txt").toURI());
  return Files.write(file, lines, Charset.forName("UTF-8"));
}

代码示例来源:origin: cdancy/bitbucket-rest

/**
 * Execute `args` at the `workingDir`.
 *
 * @param args list of arguments to pass to Process.
 * @param workingDir directory to execute Process within.
 * @return possible output of Process.
 * @throws Exception if Process could not be successfully executed.
 */
public static String executionToString(final List<String> args, final Path workingDir) throws Exception {
  assertThat(args).isNotNull().isNotEmpty();
  assertThat(workingDir).isNotNull();
  assertThat(workingDir.toFile().isDirectory()).isTrue();
  final Process process = new ProcessBuilder(args)
      .directory(workingDir.toFile())
      .start();
  return Strings2.toStringAndClose(process.getInputStream());
}

相关文章