title: @NotNull annotation is not working in Spring boot application
body: <p>Below is my DTO class.</p>
  
  <pre><code>public class AbstractDTO extends BaseDTO {
  
      private Integer createdBy;
  
      @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DATE_FORMAT)
      @NotNull(message = "createdDate may not be null")
      private LocalDateTime createdDate;
  
      private Integer lastModifiedBy;
      @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DATE_FORMAT)
      private LocalDateTime lastModifiedDate;
  
      private Boolean isActive;
  
      // getter &amp; setters
  }
  </code></pre>
  
  <p>Here I am trying to annotate createdDate field as @NotNull but is it not working. It is allowing in request body and after executing the service in postman not getting any error.</p>
  
  <p>I have tried below options but no luck.</p>
  
  <p><strong>1) Tried to add maven dependency.</strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>2) Tried to annotate DTO class as @Validated</strong></p>
  
  <p><strong>3) Tried to annotate createdDate field @Valid with @NotNull but still not luck.</strong></p>
  
  <p>Please help me out with this issue. </p>