October 2018
Intermediate to advanced
590 pages
15h 5m
English
First of all, let's create the com.taskagile.web.payload.RegistrationPayloadTests unit test class. In this test class, we will create an instance of javax.validation.Validator to perform data validation. We will still follow the [UnitOfWork_StateUnderTest_ExpectedBehavior] convention for naming the test methods. Here is how the RegistrationPayloadTests looks:
...public class RegistrationPayloadTests { private Validator validator; @Before public void setup () { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); validator = factory.getValidator(); } @Test public void validate_blankPayload_shouldFail() { RegistrationPayload payload = new RegistrationPayload(); Set<ConstraintViolation<RegistrationPayload>> ...Read now
Unlock full access