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.
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