문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:equals_verifier [2015/08/31 16:58] kwon37xi |
java:equals_verifier [2016/08/17 17:20] kwon37xi |
||
---|---|---|---|
줄 21: | 줄 21: | ||
</ | </ | ||
* 커버리지가 낮게 나오면 '' | * 커버리지가 낮게 나오면 '' | ||
+ | |||
+ | ===== IntelliJ Live Template ===== | ||
+ | ==== java ==== | ||
+ | <code java> | ||
+ | class Sub$CLASS$ extends $CLASS$ { | ||
+ | @Override | ||
+ | public boolean canEqual(Object obj) { | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | EqualsVerifier.forClass($CLASS$.class) | ||
+ | .suppress(Warning.NULL_FIELDS, | ||
+ | .withRedefinedSubclass(Sub$CLASS$.class) | ||
+ | .verify(); | ||
+ | </ | ||
+ | * Applicable in Java: statement | ||
+ | * Reformat according to style : check | ||
+ | * Use static import if possible : check | ||
+ | * Short FQ names : check | ||
+ | |||
+ | ==== Groovy Spock ==== | ||
+ | <code groovy> | ||
+ | static class Sub$CLASS$ extends $CLASS$ { | ||
+ | @Override | ||
+ | public boolean canEqual(Object obj) { | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | def " | ||
+ | expect: | ||
+ | EqualsVerifier.forClass($CLASS$.class) | ||
+ | .suppress(nl.jqno.equalsverifier.Warning.NONFINAL_FIELDS, | ||
+ | .withRedefinedSubclass(Sub$CLASS$.class) | ||
+ | .withRedefinedSuperclass() | ||
+ | .verify(); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * Applicable in Spock Specification | ||
+ | * Reformat according to style : check | ||
+ | * Use static import if possible : check | ||
+ | * Short FQ names : check |