JUnit tests for POJOs

后端 未结 17 1833
Happy的楠姐
Happy的楠姐 2021-02-02 07:56

I work on a project where we have to create unit tests for all of our simple beans (POJOs). Is there any point to creating a unit test for POJOs if all they consist of is gette

17条回答
  •  灰色年华
    2021-02-02 08:24

    This problem can be resolved by using the Lombok library which eliminates all this boilerplate code as well as the equals and hashcode.

    So you don't need to test them unless you have a specific requirement for the equals and hashcode

    https://projectlombok.org/

提交回复
热议问题