I created the following service interface:
import javax.validation.constraints.NotBlank;
import org.springframework.lang.NonNull;
import org.springframework.validation.annotation.Validated;
@Validated
public interface UserService {
User create(@NonNull Long telegramId, @NotBlank String name, @NonNull Boolean isBot);
}
but the following invocation:
userService.create(telegramId, "Mike", null);
passes the @NotNull validation for isBot parameter. How to correctly configure Spring Boot and my service in order to take into account @NonNull annotation and prevent method execution in case of null parameter?