  @Test
  public void simulationMode() throws IOException {

    project = mock(Project.class);
    Properties props = new Properties();
    File out = folder.newFile();
    props.put("sonar.scanner.dumpToFile", out.getAbsolutePath());
    when(project.getProperties()).thenReturn(props);

    task = new SonarQubeTask();

    File baseDir = folder.newFolder();
    when(project.getBaseDir()).thenReturn(baseDir);
    task.setProject(project);

    task.execute();

    Properties outProps = new Properties();
    try (BufferedReader reader = Files.newBufferedReader(out.toPath(), StandardCharsets.UTF_8)) {
      outProps.load(reader);
    }

    assertThat(outProps.entrySet()).extracting(Map.Entry::getKey, Map.Entry::getValue)
      .contains(
        tuple("sonar.projectBaseDir", baseDir.getAbsolutePath()),
        tuple("sonar.scanner.app", "Ant"));
  }