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
From the course: Java EE: Bean Validation
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Built-in constraints introduction5m 4s
-
(Locked)
Null constraints introduction2m 4s
-
(Locked)
Null constraints implementation5m 8s
-
(Locked)
Numerical constraints introduction2m 33s
-
(Locked)
Numerical constraints implementation6m 10s
-
(Locked)
Pattern, Boolean, and date constraints introduction2m 4s
-
(Locked)
Pattern, Boolean, and date constraints implementation6m 24s
-
-
-
-
-
-