How to test abstract class in Java with JUnit?

后端 未结 10 1239
野趣味
野趣味 2020-11-27 04:46

I am new to Java testing with JUnit. I have to work with Java and I would like to use unit tests.

My problem is: I have an abstract class with some abstract methods.

10条回答
  •  盖世英雄少女心
    2020-11-27 05:11

    My way of testing this is quite simple, within each abstractUnitTest.java. I simply create a class in the abstractUnitTest.java that extend the abstract class. And test it that way.

提交回复
热议问题