Java - contract tests

后端 未结 2 1345
温柔的废话
温柔的废话 2021-01-22 06:40

I am trying to write contract tests for some widely used interfaces:

Along the lines of:

public abstract class MyInterfaceContractTest extends TestCase {         


        
2条回答
  •  情书的邮戳
    2021-01-22 07:07

    Generally the approach would be to use a "testable" subclass of the abstract class to test all the functionality of the abstract class in one test. Then write a separate test for each concrete implementation testing just the methods defined / implemented in the concrete class (don't retest the functionality in the concrete class).

提交回复
热议问题