I have a single method which is really comprehensive. Within this method couple of other methods are called and each method depends on the previous one.
My question is: What is the best approach to test this complex method using JUnit?
Can I just create one single @Test Method and calling the other methods within this method? For example:
@Test
public void testRun(){
testMethod1();
testMethod2();
...
}
testMethod1(){
assertNotEquals();
...
}
I can´t believe that it is that easy. Wouldn´t it be better to test each method on their own? But how can I implement that? Are their any best practises?
But maybe this is the right way.
Thanks for any suggestions !:)