public Path metadataFilePath() {
    Optional<String> metadataFilePath = configuration.get(METADATA_FILE_PATH_KEY);
    if (metadataFilePath.isPresent()) {
      Path metadataPath = Paths.get(metadataFilePath.get());
      if (!metadataPath.isAbsolute()) {
        throw MessageException.of(String.format("Property '%s' must point to an absolute path: %s", METADATA_FILE_PATH_KEY, metadataFilePath.get()));
      }
      return project.getBaseDir().resolve(metadataPath);
    } else {
      return project.getWorkDir().resolve(METADATA_DUMP_FILENAME);
    }
  }
@Test
  public void should_define_metadata_file_path() throws IOException {
    Path path = temp.newFolder().toPath().resolve("report");
    settings.setProperty("sonar.scanner.metadataFilePath", path.toString());
    assertThat(underTest.metadataFilePath()).isEqualTo(path);
  }