### Question:
TppUriHeaderValidator implements BusinessValidator<TppRedirectUri>, PaymentHeaderValidator, ConsentHeaderValidator { @Override public @NotNull Set<TppMessageInformation> buildWarningMessages(@NotNull TppRedirectUri tppRedirectUri) { Set<TppMessageInformation> warnings = new HashSet<>(); if (isRedirectScaApproach()) { warnings.addAll(tppDomainValidator.buildWarningMessages(tppRedirectUri.getUri())); if (StringUtils.isNotBlank(tppRedirectUri.getNokUri())) { warnings.addAll(tppDomainValidator.buildWarningMessages(tppRedirectUri.getNokUri())); } } return warnings; }  @Override @NotNull ValidationResult validate(@NotNull TppRedirectUri tppRedirectUri); @Override @NotNull Set<TppMessageInformation> buildWarningMessages(@NotNull TppRedirectUri tppRedirectUri); @Override MessageError validate(Map<String, String> headers, MessageError messageError);  }### Answer:
@Test void buildWarningMessages_emptySet() { when(scaApproachResolver.resolveScaApproach()).thenReturn(ScaApproach.REDIRECT); Set<TppMessageInformation> emptySet = new HashSet<>(); when(tppDomainValidator.buildWarningMessages(any())).thenReturn(emptySet); Set<TppMessageInformation> actual = validator.buildWarningMessages(TPP_REDIRECT_URIs); assertEquals(actual, emptySet); verify(tppDomainValidator, times(2)).buildWarningMessages(any()); }
@Test void buildWarningMessages_noCheck() { when(scaApproachResolver.resolveScaApproach()).thenReturn(ScaApproach.EMBEDDED); Set<TppMessageInformation> emptySet = new HashSet<>(); Set<TppMessageInformation> actual = validator.buildWarningMessages(TPP_REDIRECT_URIs); assertEquals(actual, emptySet); verify(tppDomainValidator, times(0)).buildWarningMessages(any()); }