In code, i call make a request via RestTemplate.exchange like this
ResponseEntity<LocationDataCarrierDTO> response = myRestTemplate.exchange(
uri,
HttpMethod.GET,
request,
LocationDataCarrierDTO.class);
And the DTO class looks like this
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class LocationDataCarrierDTO {
@NotNull
private GpsDTO gpsData;
}
Is the @NotNull-Validation annotation taken into account by exchange? Aka: does the call to exchange throw an exception if gpsData is NULL?