I keep getting validator error for quite simple configuration class
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
@Component
@Data
@Validated
@ConfigurationProperties(prefix = "test")
public class TestProperties {
@NotBlank
String uri;
}
Error is self explaining:
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.String'. Check configuration for 'uri'
But according to spring boot documentation this should work.