Does anyone do test cases for pojos?

It's necessary?

+3
source share
16 answers

I write explicit tests for everything except simple getters and setters.

If the getter or setter contains only the reverse bla; or this.blah = blah; I do not think there is much value. In most cases, they are generated, and I feel that time spent together can be better spent elsewhere.

+6
source

, . POJO ( Java) Java, . IOC (Inversion Of Control), Spring, POJO, .

Java bean - Java-, getBlah() setBlah(), . Java beans POJO.

, : " POJO ( -)?" .

: " Java beans ( - )?" , , .

+4

PoJos , , , , .

, . , .

+2

"". , : . , , , , , .

, , , - , , (.. , - ).

, pojos , , .

.

+2

, . -.

+1

POJO . , ( , ). ; , , , :-) , Cobertura, Clover Emma , . , .

+1

, , , . , - TDD, , , POJO ( POCOs .net peeps) . , TDD /​​, unit test.

, TDD , , IMHO.

+1

, , , , .

, POJO, , , - . POJO equals() hashCode().:) POJO !:)

, equals() hashCode() !

+1

Pojos .

0

, !;)

0

, . , , .

0

, ?

Test Driven Development, pojos (, , pojos).

0

. , ...

.

0

, " " , .

0

"" :

  • - cc,
  • - - , , , ( ).

, ...

0

, POJO, :

1. POJO , POJO , , . POJO.

2. POJO , /getters/seters, , (CGLIB). , POJO.

-1

Source: https://habr.com/ru/post/1697095/


All Articles