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

x33g5p2x  于11个月前 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(42)

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

AbstractFileAssert.isNotNull介绍

暂无

代码示例

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

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

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

@Test
public void testTryGetCanonicalFileElseGetAbsoluteFileHandlesIOException() throws IOException {
 final File mockFile = mock(File.class);
 when(mockFile.getAbsoluteFile()).thenReturn(mock(File.class));
 when(mockFile.getCanonicalFile()).thenThrow(new IOException("Mock Exception"));
 final File file = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(mockFile);
 assertThat(file).isNotNull();
 assertThat(file.exists()).isFalse();
 InOrder inOrder = Mockito.inOrder(mockFile);
 inOrder.verify(mockFile).getCanonicalFile();
 inOrder.verify(mockFile).getAbsoluteFile();
}

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

@Test
public void testTryGetCanonicalFileElseGetAbsoluteFile() throws IOException {
 final File mockFile = mock(File.class);
 when(mockFile.getCanonicalFile()).thenReturn(mock(File.class));
 final File file = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(mockFile);
 assertThat(file).isNotNull();
 assertThat(file.exists()).isFalse();
 verify(mockFile, times(1)).getCanonicalFile();
 verify(mockFile, times(0)).getAbsoluteFile();
}

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

@Test
 public void createFileFromResource() throws Exception {
  File file =
    ResourceUtils.createFileFromResource(resource, temporaryFolder.getRoot(), resourceName);
  assertThat(file).isNotNull().exists();

  List<String> content = FileUtils.readLines(file, Charset.defaultCharset());
  assertThat(content).contains(RESOURCE_CONTENT);
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void should_not_skip_report_for_unchanged_files_in_short_branch() {
 // sanity check, normally report gets generated
 AnalysisResult result = getResult(tester);
 assertThat(getResult(tester).getReportComponent(result.inputFile(FILE_PATH))).isNotNull();
 int fileId = 2;
 assertThat(result.getReportReader().readChangesets(fileId)).isNotNull();
 assertThat(result.getReportReader().hasCoverage(fileId)).isTrue();
 assertThat(result.getReportReader().readFileSource(fileId)).isNotNull();
 // file is not skipped for short branches (need coverage, duplications coming soon)
 AnalysisResult result2 = getResult(tester.setBranchType(BranchType.SHORT));
 assertThat(result2.getReportComponent(result2.inputFile(FILE_PATH))).isNotNull();
 assertThat(result2.getReportReader().readChangesets(fileId)).isNull();
 assertThat(result2.getReportReader().hasCoverage(fileId)).isTrue();
 assertThat(result2.getReportReader().readFileSource(fileId)).isNull();
}

代码示例来源:origin: line/centraldogma

@Test
public void tlsConfig() throws Exception {
  final String cert = Jackson.escapeText(folder.newFile().getAbsolutePath());
  final String key = Jackson.escapeText(folder.newFile().getAbsolutePath());
  final String jsonConfig = String.format("{\"tls\": {" +
                      "\"keyCertChainFile\": \"%s\", " +
                      "\"keyFile\": \"%s\", " +
                      "\"keyPassword\": null " +
                      "}}", cert, key);
  final ParentConfig parentConfig = Jackson.readValue(jsonConfig, ParentConfig.class);
  final TlsConfig tlsConfig = parentConfig.tlsConfig;
  assertThat(tlsConfig.keyCertChainFile()).isNotNull();
  assertThat(tlsConfig.keyCertChainFile().canRead()).isTrue();
  assertThat(tlsConfig.keyFile()).isNotNull();
  assertThat(tlsConfig.keyFile().canRead()).isTrue();
  assertThat(tlsConfig.keyPassword()).isNull();
}

代码示例来源:origin: org.drools/drools-cdi

@Test
public void testParsePomPropertiesFromJarDir() throws Exception {
  createKieModule(MODULE_JARDIR_NAME, false, MODULE_JARDIR_VERSION);
  final File kModuleDir = getFileManager().newFile(MODULE_JARDIR_NAME + "-" + MODULE_JARDIR_VERSION);
  Assertions.assertThat(kModuleDir).isNotNull();
  Assertions.assertThat(kModuleDir).isDirectory();
  kModuleDir.renameTo(new File(kModuleDir.getAbsolutePath() + ".jar"));
  final File kModuleFile = getFileManager().newFile(MODULE_JARDIR_NAME + "-" + MODULE_JARDIR_VERSION + ".jar");
  final String pomProperties = ClasspathKieProject.getPomProperties(kModuleFile.getAbsolutePath());
  checkPomProperties(pomProperties, MODULE_JARDIR_NAME, MODULE_JARDIR_VERSION);
}

代码示例来源:origin: spring-projects/spring-integration-aws

assertThat(putObjectRequest.getBucketName()).isEqualTo(S3_BUCKET_NAME);
assertThat(putObjectRequest.getKey()).isEqualTo("foo.mp3");
assertThat(putObjectRequest.getFile()).isNotNull();
assertThat(putObjectRequest.getInputStream()).isNull();

代码示例来源:origin: kiegroup/appformer

assertThat(fs.getPath("file.txt").toFile()).isNotNull().exists();

代码示例来源:origin: kiegroup/appformer

assertThat(fs.getPath("file.txt").toFile()).isNotNull().exists();

代码示例来源:origin: org.uberfire/uberfire-nio2-jgit

assertThat(fs.getPath("file.txt").toFile()).isNotNull().exists();

代码示例来源:origin: org.uberfire/uberfire-nio2-jgit

assertThat(fs.getPath("file.txt").toFile()).isNotNull().exists();

相关文章