### Question:
ResponseAssertionsFromCountryValidator { public void validate(ValidatedResponse validatedResponse, Assertion validatedIdentityAssertion) { assertionValidator.validateEidas( validatedIdentityAssertion, validatedResponse.getInResponseTo(), expectedRecipientId ); if (validatedResponse.isSuccess()) { if (validatedIdentityAssertion.getAuthnStatements().size() > 1) { SamlValidationSpecificationFailure failure = SamlTransformationErrorFactory.multipleAuthnStatements(); throw new SamlTransformationErrorException(failure.getErrorMessage(), failure.getLogLevel()); } authnStatementAssertionValidator.validate(validatedIdentityAssertion); eidasAttributeStatementAssertionValidator.validate(validatedResponse, validatedIdentityAssertion); authnResponseIssuerValidator.validate(validatedResponse, validatedIdentityAssertion); } } ResponseAssertionsFromCountryValidator(
        IdentityProviderAssertionValidator assertionValidator,
        EidasAttributeStatementAssertionValidator eidasAttributeStatementAssertionValidator,
        AuthnStatementAssertionValidator authnStatementAssertionValidator,
        EidasAuthnResponseIssuerValidator authnResponseIssuerValidator,
        String expectedRecipientId); void validate(ValidatedResponse validatedResponse, Assertion validatedIdentityAssertion);  }### Answer:
@Test(expected = SamlTransformationErrorException.class) public void shouldThrowIfMultipleAuthnStatements() { when(assertion.getAuthnStatements()).thenReturn(List.of(authnStatement, authnStatement)); validator.validate(validatedResponse, assertion); }
@Test public void shouldValidateAssertion() { validator.validate(validatedResponse, assertion); verify(assertionValidator).validateEidas(assertion, validatedResponse.getInResponseTo(), EXPECTED_RECIPIENT_ID); verify(authnStatementAssertionValidator).validate(assertion); verify(eidasAttributeStatementAssertionValidator).validate(validatedResponse, assertion); }
@Test public void shouldNotValidateAssertionContentsIfResponseIsFailure() { when(validatedResponse.isSuccess()).thenReturn(false); validator.validate(validatedResponse, assertion); verifyNoInteractions(authnStatementAssertionValidator, eidasAttributeStatementAssertionValidator); }
@Test public void validateIssuer() { validator.validate(validatedResponse, assertion); verify(authnResponseIssuerValidator).validate(validatedResponse, assertion); verifyNoMoreInteractions(authnResponseIssuerValidator); }