jeudi 29 octobre 2015

Java JUnit Refactoring Tests to remove identical tests

I am new to JUnit. Currently have two separate JUnit test classes which both have 4 tests in, except one of the tests is identical for both test classes. Is there an easy way of somehow refactoring the code so that I can in a way 'import' the common test into both classes?

I have considered making a superclass to extract the common tests, however in this case it seems a bit overkill.

Any suggestions?

Many thanks.

Aucun commentaire:

Enregistrer un commentaire