Ejemplo n.º 1
0
  @Test
  public void should_delete_report_by_default() throws IOException {
    Path reportDir = temp.getRoot().toPath().resolve("batch-report");
    Files.createDirectory(reportDir);
    ReportPublisher job =
        new ReportPublisher(
            settings,
            wsClient,
            server,
            contextPublisher,
            reactor,
            mode,
            mock(TempFolder.class),
            new ReportPublisherStep[0]);

    job.start();
    job.stop();
    assertThat(reportDir).doesNotExist();
  }
Ejemplo n.º 2
0
  @Test
  public void should_not_delete_report_if_property_is_set() throws IOException {
    settings.setProperty("sonar.batch.keepReport", true);
    Path reportDir = temp.getRoot().toPath().resolve("batch-report");
    Files.createDirectory(reportDir);
    ReportPublisher underTest =
        new ReportPublisher(
            settings,
            wsClient,
            server,
            contextPublisher,
            reactor,
            mode,
            mock(TempFolder.class),
            new ReportPublisherStep[0]);

    underTest.start();
    underTest.stop();
    assertThat(reportDir).isDirectory();
  }