Class PreserveLogLevelRule

java.lang.Object
com.atlassian.bamboo.testutils.junit.rule.PreserveLogLevelRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class PreserveLogLevelRule extends Object implements org.junit.rules.TestRule
Rule that allows modifying Log4j's log level during test and restores original level afterwards. Useful in wired tests.
  • Constructor Details

    • PreserveLogLevelRule

      public PreserveLogLevelRule()
  • Method Details

    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
      Specified by:
      apply in interface org.junit.rules.TestRule
    • changeLevel

      public void changeLevel(Class clazz, org.apache.log4j.Level level)
    • changeLevel

      public void changeLevel(String className, org.apache.log4j.Level level)