public class

ClearStatics

extends TestWatcher
java.lang.Object
   ↳ org.junit.rules.TestWatcher
     ↳ com.atlassian.jira.junit.rules.ClearStatics

Class Overview

Clear static variables in JIRA both before and after the test runs to improve test separation.

This clears out things like the component accessor's worker, the authentication context, thread local searcher data, database configuration, and webwork configuration that may pollute this or some other test.

Just add this to your test:

     @Rule public ClearStatics clearStatics = new ClearStatics();
 

Summary

Public Constructors
ClearStatics()
Protected Methods
void finished(Description description)
void starting(Description description)
[Expand]
Inherited Methods
From class org.junit.rules.TestWatcher
From class java.lang.Object
From interface org.junit.rules.TestRule

Public Constructors

public ClearStatics ()

Protected Methods

protected void finished (Description description)

protected void starting (Description description)