@Override
  public QualityGate findEffectiveQualityGate(Project project) {
    return findQualityGate(project).orElseGet(this::findDefaultQualityGate);
  }
@Test
  public void findDefaultQualityGate_by_property_found() {
    QualityGateDto qualityGateDto = new QualityGateDto();
    qualityGateDto.setUuid(QUALITY_GATE_DTO.getUuid());
    qualityGateDto.setName(QUALITY_GATE_DTO.getName());

    when(qualityGateDao.selectDefault(any())).thenReturn(qualityGateDto);
    when(qualityGateConditionDao.selectForQualityGate(any(), eq(SOME_UUID))).thenReturn(ImmutableList.of(CONDITION_1, CONDITION_2));
    when(metricRepository.getOptionalByUuid(METRIC_UUID_1)).thenReturn(Optional.empty());
    when(metricRepository.getOptionalByUuid(METRIC_UUID_2)).thenReturn(Optional.of(METRIC_2));

    QualityGate result = underTest.findEffectiveQualityGate(mock(Project.class));

    assertThat(result).isNotNull();
    assertThat(result.getUuid()).isEqualTo(QUALITY_GATE_DTO.getUuid());
    assertThat(result.getName()).isEqualTo(QUALITY_GATE_DTO.getName());
  }