### Question:
EncryptedResponseFromIdpValidator { public void validate(Response response) { IssuerValidator.validate(response); RequestIdValidator.validate(response); validateResponse(response); } EncryptedResponseFromIdpValidator(final SamlStatusToAuthenticationStatusCodeMapper<T> statusCodeMapper); void validate(Response response);  }### Answer:
@Test public void validateRequest_shouldNotErrorIfRequestIsSigned() throws Exception { Response response = getResponseBuilderWithTwoAssertions().build(); validator.validate(response); }
@Test public void validateIssuer_shouldNotErrorIfFormatAttributeIsMissing() throws Exception { Issuer issuer = anIssuer().withFormat(null).build(); Response response = getResponseBuilderWithTwoAssertions().withIssuer(issuer).build(); validator.validate(response); }
@Test public void validateIssuer_shouldNotErrorIfFormatAttributeHasValidValue() throws Exception { Issuer issuer = anIssuer().withFormat(NameIDType.ENTITY).build(); Response response = getResponseBuilderWithTwoAssertions().withIssuer(issuer).build(); validator.validate(response); }
@Test public void validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusAuthnFailed() throws Exception { Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(StatusCode.AUTHN_FAILED)); Response response = aResponse().withStatus(status).withNoDefaultAssertion().build(); validator.validate(response); }
@Test public void validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusNoAuthnContext() throws Exception { Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(StatusCode.NO_AUTHN_CONTEXT)); Response response = aResponse().withStatus(status).withNoDefaultAssertion().build(); validator.validate(response); }
@Test public void validateStatus_shouldNotErrorIfStatusIsRequesterWithNoSubStatus() throws Exception { Status status = createStatus(StatusCode.REQUESTER); Response response = aResponse().withStatus(status).withNoDefaultAssertion().build(); validator.validate(response); }
@Test public void validateStatus_shouldNotErrorIfStatusIsSuccessWithNoSubStatus() throws Exception { Status status = createStatus(StatusCode.SUCCESS); Response response = getResponseBuilderWithTwoAssertions().withStatus(status).build(); validator.validate(response); }