@Test
  public void toMeasure_for_LEVEL_Metric_can_have_an_qualityGateStatus() {
    MeasureDto measureDto =
        new MeasureDto()
            .setData(Level.OK.name())
            .setAlertStatus(Level.ERROR.name())
            .setAlertText(SOME_ALERT_TEXT);

    Optional<Measure> measure = underTest.toMeasure(measureDto, SOME_LEVEL_METRIC);

    assertThat(measure).isPresent();
    assertThat(measure.get().getValueType()).isEqualTo(Measure.ValueType.LEVEL);
    assertThat(measure.get().getLevelValue()).isEqualTo(Level.OK);
    assertThat(measure.get().getQualityGateStatus().getStatus()).isEqualTo(Level.ERROR);
    assertThat(measure.get().getQualityGateStatus().getText()).isEqualTo(SOME_ALERT_TEXT);
  }
  @Test
  public void toMeasure_maps_alert_properties_in_dto_for_String_Metric() {
    MeasureDto measureDto =
        new MeasureDto()
            .setData(SOME_DATA)
            .setAlertStatus(Level.OK.name())
            .setAlertText(SOME_ALERT_TEXT);

    Optional<Measure> measure = underTest.toMeasure(measureDto, SOME_STRING_METRIC);

    assertThat(measure.isPresent());
    assertThat(measure.get().getValueType()).isEqualTo(Measure.ValueType.STRING);
    assertThat(measure.get().getStringValue()).isEqualTo(SOME_DATA);
    assertThat(measure.get().getData()).isEqualTo(SOME_DATA);
    assertThat(measure.get().getQualityGateStatus().getStatus()).isEqualTo(Level.OK);
    assertThat(measure.get().getQualityGateStatus().getText()).isEqualTo(SOME_ALERT_TEXT);
  }
  @Test
  public void toMeasure_maps_data_and_alert_properties_in_dto_for_Boolean_metric() {
    MeasureDto measureDto =
        new MeasureDto()
            .setValue(1d)
            .setData(SOME_DATA)
            .setAlertStatus(Level.OK.name())
            .setAlertText(SOME_ALERT_TEXT);

    Optional<Measure> measure = underTest.toMeasure(measureDto, SOME_BOOLEAN_METRIC);

    assertThat(measure.isPresent());
    assertThat(measure.get().getValueType()).isEqualTo(Measure.ValueType.BOOLEAN);
    assertThat(measure.get().getBooleanValue()).isTrue();
    assertThat(measure.get().getData()).isEqualTo(SOME_DATA);
    assertThat(measure.get().getQualityGateStatus().getStatus()).isEqualTo(Level.OK);
    assertThat(measure.get().getQualityGateStatus().getText()).isEqualTo(SOME_ALERT_TEXT);
  }
  @Test
  public void toMeasure_maps_data_and_alert_properties_in_dto_for_Double_Metric() {
    MeasureDto measureDto =
        new MeasureDto()
            .setValue(10.6395d)
            .setData(SOME_DATA)
            .setAlertStatus(Level.OK.name())
            .setAlertText(SOME_ALERT_TEXT);

    Optional<Measure> measure = underTest.toMeasure(measureDto, SOME_DOUBLE_METRIC);

    assertThat(measure.isPresent());
    assertThat(measure.get().getValueType()).isEqualTo(Measure.ValueType.DOUBLE);
    assertThat(measure.get().getDoubleValue()).isEqualTo(10.6d);
    assertThat(measure.get().getData()).isEqualTo(SOME_DATA);
    assertThat(measure.get().getQualityGateStatus().getStatus()).isEqualTo(Level.OK);
    assertThat(measure.get().getQualityGateStatus().getText()).isEqualTo(SOME_ALERT_TEXT);
  }