@Test
  public void statusShouldReturnJsonFromStatusFile() throws Exception {
    // given: FileProcessController with pidFile containing real pid
    FileUtils.writeStringToFile(pidFile, String.valueOf(pid), Charset.defaultCharset());
    FileProcessController controller = new FileProcessController(params, pid, 2, MINUTES);

    // create an empty dummy stale status file that needs to be deleted before we write our own
    // "real" status file
    statusFile.createNewFile();
    // when: status is called in one thread
    executorServiceRule.execute(() -> {
      try {
        statusRef.set(controller.status());
      } catch (Exception e) {
        errorCollector.addError(e);
      }
    });
    await().untilAsserted(() -> assertThat(statusFile.exists()).isEqualTo(false));

    // and: json is written to the status file
    FileUtils.writeStringToFile(statusFile, STATUS_JSON, Charset.defaultCharset());

    // then: returned status should be the json in the file
    await().untilAsserted(() -> assertThat(statusRef.get()).isEqualTo(STATUS_JSON));
  }
Integration tests for {@link FileProcessController}.

<p>
This test shows one of the more appropriate uses of ErrorCollector Rule -- catching any failed
assertions in another thread that isn't the main JUnit thread.
geode-core/src/integrationTest/java/org/apache/geode/internal/process/FileProcessControllerIntegrationTest.java