I'm trying to use my repository interface looks like this.
interface SomeRepository extends JpaRepository<Some, Long> {
@org.springframework.lang.Nullable
Some findByKey(
@org.springframework.lang.NonNull
@javax.validation.constraint.NotNull
final String key);
}
And I found those constraints don't work as expected.
@Test
void findByKeyWithNullKey() {
repository.findByKey(null);
}
The test case simply passes.
How can I make it work?