Class RestoreThreadContextClassloader

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public final class RestoreThreadContextClassloader
    extends org.junit.rules.ExternalResource
    A JUnit Rule which makes sure that the Thread context Classloader is the same after the test completes as was present before it started.
    Since:
    7.20
    • Constructor Detail

      • RestoreThreadContextClassloader

        public RestoreThreadContextClassloader()
    • Method Detail

      • before

        protected void before()
                       throws Throwable
        Overrides:
        before in class org.junit.rules.ExternalResource
        Throws:
        Throwable
      • after

        protected void after()
        Overrides:
        after in class org.junit.rules.ExternalResource