use of com.tngtech.java.junit.dataprovider.UseDataProvider in project sonarqube by SonarSource.
the class MeasureToMeasureDtoTest method toMeasureDto_returns_Dto_without_any_variation_if_Measure_has_no_MeasureVariations.
@Test
@UseDataProvider("all_types_Measures")
public void toMeasureDto_returns_Dto_without_any_variation_if_Measure_has_no_MeasureVariations(Measure measure, Metric metric) {
MeasureDto measureDto = underTest.toMeasureDto(measure, metric, SOME_COMPONENT);
assertThat(measureDto.getVariation()).isNull();
}
use of com.tngtech.java.junit.dataprovider.UseDataProvider in project sonarqube by SonarSource.
the class MeasureToMeasureDtoTest method toMeasureDto_set_componentId_and_snapshotId_from_method_arguments.
@Test
@UseDataProvider("all_types_Measures")
public void toMeasureDto_set_componentId_and_snapshotId_from_method_arguments(Measure measure, Metric metric) {
MeasureDto measureDto = underTest.toMeasureDto(measure, metric, SOME_COMPONENT);
assertThat(measureDto.getComponentUuid()).isEqualTo(SOME_COMPONENT.getUuid());
// assertThat(measureDto.getSnapshotId()).isEqualTo(SOME_SNAPSHOT_ID);
}
use of com.tngtech.java.junit.dataprovider.UseDataProvider in project sonarqube by SonarSource.
the class MeasureToMeasureDtoTest method toMeasureDto_returns_Dto_without_alertStatus_nor_alertText_if_Measure_has_no_QualityGateStatus.
@Test
@UseDataProvider("all_types_Measures")
public void toMeasureDto_returns_Dto_without_alertStatus_nor_alertText_if_Measure_has_no_QualityGateStatus(Measure measure, Metric metric) {
MeasureDto measureDto = underTest.toMeasureDto(measure, metric, SOME_COMPONENT);
assertThat(measureDto.getAlertStatus()).isNull();
assertThat(measureDto.getAlertText()).isNull();
}
use of com.tngtech.java.junit.dataprovider.UseDataProvider in project sonarqube by SonarSource.
the class PurgeDatastoresStepTest method do_not_call_purge_method_of_the_purge_task_for_other_views_components.
@Test
@UseDataProvider("nonRootViewsComponentTypes")
public void do_not_call_purge_method_of_the_purge_task_for_other_views_components(Component.Type type) {
Component component = ViewsComponent.builder(type, PROJECT_KEY).setUuid(PROJECT_UUID).build();
verify_do_not_call_purge_method_of_the_purge_task(component);
}
use of com.tngtech.java.junit.dataprovider.UseDataProvider in project sonarqube by SonarSource.
the class ServerLoggingTest method changeLevel_calls_changeRoot_with_LogLevelConfig_and_level_converted_to_logback_class_then_log_INFO_message.
@Test
@UseDataProvider("supportedSonarApiLevels")
public void changeLevel_calls_changeRoot_with_LogLevelConfig_and_level_converted_to_logback_class_then_log_INFO_message(LoggerLevel level) {
ServerProcessLogging serverProcessLogging = mock(ServerProcessLogging.class);
LogLevelConfig logLevelConfig = LogLevelConfig.newBuilder().build();
when(serverProcessLogging.getLogLevelConfig()).thenReturn(logLevelConfig);
underTest.changeLevel(serverProcessLogging, level);
verify(logbackHelper).changeRoot(logLevelConfig, Level.valueOf(level.name()));
}
Aggregations