@Override
  public void onIssueChanges(QGChangeEvent qualityGateEvent, Set<ChangedIssue> changedIssues) {
    Optional<EvaluatedQualityGate> evaluatedQualityGate = qualityGateEvent.getQualityGateSupplier().get();
    Optional<Metric.Level> previousStatusOptional = qualityGateEvent.getPreviousStatus();
    if (evaluatedQualityGate.isEmpty() || previousStatusOptional.isEmpty()) {
      return;
    }
    Metric.Level currentStatus = evaluatedQualityGate.get().getStatus();
    Metric.Level previousStatus = previousStatusOptional.get();
    if (previousStatus.getColorName().equals(currentStatus.getColorName())) {
      // QG status didn't change - no action
      return;
    }

    addQualityGateEventToProject(qualityGateEvent, currentStatus);
  }
@Test
  public void onIssueChanges_givenEmptyEvent_doNotInteractWithDatabase() {
    Supplier<Optional<EvaluatedQualityGate>> qualityGateSupplier = Optional::empty;

    QGChangeEvent qualityGateEvent = new QGChangeEvent(project, branch, analysis, projectConfiguration, Metric.Level.OK, qualityGateSupplier);

    underTest.onIssueChanges(qualityGateEvent, Set.of());

    verifyNoInteractions(dbClient);
  }