You should clarify what you mean by "nested". Valid Java requires that each public class resides within its own *.java file of the same name. Therefore, your code example is asking for the test class CreateClientFormTest to run with Mockito when there is no @RunWith(MockitoJUnitRunner.class) defined in that source file.
–
BradJul 4 '12 at 13:51

2 Answers
2

However, from your example it's not clear why you need nested tests. The typical reason to use them is to share setup behavior, but you should consider if having separate test classes is more appropriate.

In any case, here's how you can do it with junit-nested: (Since Nested is a test runner, you'll have to use MockitoAnnotations.initMocks() instead of the Mockito test runner.)