From the course: Java EE: Bean Validation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Null constraints implementation

Null constraints implementation

From the course: Java EE: Bean Validation

Start my 1-month free trial

Null constraints implementation

- [Instructor] What I also need to do is to set a date on the client class. Because the client class expects to receive a date of birth. I also need an instance of date format. So I'm just going to create that here. DateFormat, I'm going to call it dateFormat, create a new simple date format. And the structure I want it to create is year, then month, and day. Now let's start with the first test. I want to ensure that validated does not trigger a validation exception. So the first test I'm going to do is a happy path, where all the data is correct. So I'm going to put this in this test here so I'm going to start by creating myself instance of the client, so new_Client, and the client has a constructor, so all I need to do is to start entering information about the client. So that's the ID, then I need to enter a name for the client, so I would enter the name John Smith, then I'm going to enter the date, so that's going to be, and use my date format, and I'm going to enter a very simple…

Contents