public boolean shouldExecute(DefaultPostJobDescriptor descriptor) {
    if (!settingsCondition(descriptor)) {
      LOG.debug("'{}' skipped because one of the required properties is missing", descriptor.name());
      return false;
    }
    return true;
  }
@Test
  public void should_optimize_on_settings() {
    DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor()
      .requireProperty("sonar.foo.reportPath");
    optimizer = new PostJobOptimizer(settings.asConfig());
    assertThat(optimizer.shouldExecute(descriptor)).isFalse();

    settings.setProperty("sonar.foo.reportPath", "foo");
    optimizer = new PostJobOptimizer(settings.asConfig());
    assertThat(optimizer.shouldExecute(descriptor)).isTrue();
  }