A Theory JUnit test is a subset of the Parameterized JUnit test feature.

It is very similar in respects to driving tests with a set of test data, except with a few differences as explained below.

  • The test class is annotated with @RunWith(Theories.class)
  • The test does not require a constructor to assign values, which reduces the code length.
  • @DataPoint and @DataPoints annotations are used to indicate that a public static variable as a source of test data.
  • @DataPoint is a single test data value same as @Parameter
  • @DataPoints is a set of test data (iterable object) same as