code-examples icon indicating copy to clipboard operation
code-examples copied to clipboard

Spring Boot Validation

Open Nandakumar-M opened this issue 3 years ago • 1 comments

Hi,

This is regarding the blog post on spring boot validation.

Under Validating Input to a Spring Service Method, the test for verifying this validation uses @ExtendWith(SpringExtension.class) and @SpringBootTest.

I am trying to keep service layer unit tests free of Spring framework (as recommended here). Unfortunately, unit tests written this way do not trigger validation.

Would be great if you can throw some light on how validation in service layer can be unit tested without using @SpringBootTest. Thanks.

Regards, Nanda

Nandakumar-M avatar Jun 04 '21 11:06 Nandakumar-M

Will try Validating Programmatically and get back on this.

Nandakumar-M avatar Jun 04 '21 11:06 Nandakumar-M