### Question:
EncryptedResponseFromMatchingServiceValidator { public void validate(Response response) { IssuerValidator.validate(response); RequestIdValidator.validate(response); validateResponse(response); }  void validate(Response response);  }### Answer:
@Test public void validateRequest_shouldDoNothingIfResponseIsSigned() throws Exception { Response response = aResponse().withStatus(happyStatus).build(); validator.validate(response); }
@Test public void validateIssuer_shouldDoNothingIfFormatAttributeIsMissing() throws Exception { Issuer issuer = anIssuer().withFormat(null).build(); Response response = aResponse().withIssuer(issuer).withStatus(happyStatus).build(); validator.validate(response); }
@Test public void validateIssuer_shouldDoNothingIfFormatAttributeHasValidValue() throws Exception { Issuer issuer = anIssuer().withFormat(NameIDType.ENTITY).build(); Response response = aResponse().withIssuer(issuer).withStatus(happyStatus).build(); validator.validate(response); }
@Test public void validate_shouldDoNothingIfAResponderStatusContainsASubStatusOfNoMatch() throws Exception { Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(SamlStatusCode.NO_MATCH)); Response response = aResponse().withStatus(status).withNoDefaultAssertion().build(); validator.validate(response); }
@Test public void validate_shouldDoNothingIfASuccessStatusContainsASubStatusOfMatch() throws Exception { Response response = aResponse().withStatus(happyStatus).build(); validator.validate(response); }
@Test public void validate_shouldDoNothingIfASuccessStatusContainsASubStatusOfNoMatch() throws Exception { Status status = createStatus(StatusCode.SUCCESS, createSubStatusCode(SamlStatusCode.NO_MATCH)); Response response = aResponse().withStatus(status).build(); validator.validate(response); }
@Test public void validate_shouldDoNothingIfAResponderStatusContainsASubStatusOfMultiMatch() throws Exception { Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(SamlStatusCode.MULTI_MATCH)); Response response = aResponse().withStatus(status).withNoDefaultAssertion().build(); validator.validate(response); }