### Question:
SamlEntityDescriptorValidator { public void validate(EntityDescriptor descriptor) { if (Strings.isNullOrEmpty(descriptor.getEntityID())) { SamlValidationSpecificationFailure failure = SamlTransformationErrorFactory.missingOrEmptyEntityID(); throw new SamlTransformationErrorException(failure.getErrorMessage(), failure.getLogLevel()); } if (descriptor.getCacheDuration() == null && descriptor.getValidUntil() == null) { SamlValidationSpecificationFailure failure = SamlTransformationErrorFactory.missingCacheDurationAndValidUntil(); throw new SamlTransformationErrorException(failure.getErrorMessage(), failure.getLogLevel()); } validateRoleDescriptor(descriptor); }  void validate(EntityDescriptor descriptor);  }### Answer:
@Test public void decorate_shouldDoNothingWhenEntityDescriptorIsValid() throws Exception { EntityDescriptor entityDescriptor = anEntityDescriptor().withIdpSsoDescriptor(IdpSsoDescriptorBuilder.anIdpSsoDescriptor().withSingleSignOnService(anEndpoint().buildSingleSignOnService()).build()).build(); validator.validate(entityDescriptor); }
@Test public void decorate_shouldNotThrowExceptionWhenEntityDescriptorIsNotSignedButNotRequired() throws Exception { EntityDescriptor entityDescriptor = anEntityDescriptor().withoutSigning().build(); validator.validate(entityDescriptor); }