assertEquals(v.isValid(email).isEqualTo(true);
This line is wrong in so many ways.
- The parentheses don't even line up.
- The
isEqualTo
thing does not start with assertEquals
- it starts with assertThat
. You're mixing two completely different ways to write tests.
- Because of the missing parens, you are now attempting to invoke
.isEqualTo
on a primitive boolean. It's not an object, primitiveExpression.anything
doesn't work in java.
You presumably want either:
assertThat(v.isValid(email)).isEqualTo(true);
or more likely:
assertTrue(v.isValid(email));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…