Search in sources :

Example 1 with LogLevelConfig

use of org.sonar.process.logging.LogLevelConfig 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()));
}
Also used : ServerProcessLogging(org.sonar.server.app.ServerProcessLogging) LogLevelConfig(org.sonar.process.logging.LogLevelConfig) Test(org.junit.Test) UseDataProvider(com.tngtech.java.junit.dataprovider.UseDataProvider)

Aggregations

UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)1 Test (org.junit.Test)1 LogLevelConfig (org.sonar.process.logging.LogLevelConfig)1 ServerProcessLogging (org.sonar.server.app.ServerProcessLogging)1