Unit Tests

The @ThreadUnsafe annotation is used to mark unit tests which can’t run in parallel on the same JVM.

All marked tests will be still be running in parallel but in forked JVMs. So that there can’t be any multi threading issues.


Annotate the test class which isn’t thread safe with @Category(ThreadUnsafe.class).

import at.rseiler.annotation.junit.ThreadUnsafe;
import org.junit.experimental.categories.Category;

public class ThreadUnsafeTest {

To use the annotation this dependency needs to be included.