문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:equals_verifier [2016/08/17 17:09] kwon37xi [IntelliJ Live Template] |
java:equals_verifier [2018/04/27 17:07] kwon37xi [Groovy Spock] |
||
---|---|---|---|
줄 45: | 줄 45: | ||
static class Sub$CLASS$ extends $CLASS$ { | static class Sub$CLASS$ extends $CLASS$ { | ||
@Override | @Override | ||
- | public | + | boolean canEqual(Object obj) { |
return false; | return false; | ||
} | } | ||
줄 51: | 줄 51: | ||
def " | def " | ||
- | def verifier = EqualsVerifier.forClass($CLASS$.class) | + | expect: |
+ | EqualsVerifier.forClass($CLASS$.class) | ||
.suppress(nl.jqno.equalsverifier.Warning.NONFINAL_FIELDS, | .suppress(nl.jqno.equalsverifier.Warning.NONFINAL_FIELDS, | ||
.withRedefinedSubclass(Sub$CLASS$.class) | .withRedefinedSubclass(Sub$CLASS$.class) | ||
.withRedefinedSuperclass() | .withRedefinedSuperclass() | ||
- | + | .verify(); | |
- | when: | + | |
- | verifier.verify(); | + | |
- | + | ||
- | then: | + | |
- | assert true | + | |
} | } | ||
</ | </ |