Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kaushikgopal/b6aa7d111d48705435ce93d4a2c22b3e to your computer and use it in GitHub Desktop.
Save kaushikgopal/b6aa7d111d48705435ce93d4a2c22b3e to your computer and use it in GitHub Desktop.
Sample use of the Enclosed.class test runner
@RunWith(Enclosed.class)
public class WorkflowStateMachineTest {
@RunWith(Parameterized.class)
public static class ParameterizedTests {
@Parameter public ISBatchType mTestBatchType; // first data value (0) is default
@Parameter(value = 1) public ISWorkflowState mTestBatchState;
@Parameters(name = "transitioning back from {1} <- for {0} batch")
public static Collection<Object[]> data() {
// return ...
}
// ...
@Test
public void shouldNotAllowMovingBack_FromParameterizedStates() {
// ...
}
}
public static class IndividualTests {
@Test
public void shouldDoSomething_LikeAnyRegularTest() {
// ...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment