public void changeLevel(LoggerLevel level) {
    Level logbackLevel = Level.toLevel(level.name());
    database.enableSqlLogging(level == TRACE);
    helper.changeRoot(serverProcessLogging.getLogLevelConfig(), logbackLevel);
    LoggerFactory.getLogger(ServerLogging.class).info("Level of logs changed to {}", level);
  }
@Test
  public void changeLevel_to_trace_enables_db_logging() {
    LogLevelConfig logLevelConfig = LogLevelConfig.newBuilder(rootLoggerName).build();
    when(serverProcessLogging.getLogLevelConfig()).thenReturn(logLevelConfig);

    reset(database);
    underTest.changeLevel(INFO);
    verify(database).enableSqlLogging(false);

    reset(database);
    underTest.changeLevel(DEBUG);
    verify(database).enableSqlLogging(false);

    reset(database);
    underTest.changeLevel(TRACE);
    verify(database).enableSqlLogging(true);
  }