use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.
the class SLOLocationTest method sameBindingReturnedWhenAvailable.
public void sameBindingReturnedWhenAvailable() {
List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
endpoints.add(endpointFor(HTTP_REDIRECT, "redirect"));
endpoints.add(endpointFor(HTTP_POST, "post"));
endpoints.add(endpointFor(SOAP, "soap"));
SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
assertThat(result.getBinding()).isEqualTo(HTTP_REDIRECT);
result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
assertThat(result.getBinding()).isEqualTo(HTTP_POST);
result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
assertThat(result.getBinding()).isEqualTo(SOAP);
}
use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.
the class SLOLocationTest method endpointFor.
private SingleLogoutServiceElement endpointFor(String binding, String location) {
SingleLogoutServiceElement ret = new SingleLogoutServiceElementImpl();
ret.setBinding(binding);
ret.setLocation(location);
return ret;
}
use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.
the class SLOLocationTest method nullReturnedIfNoBindingAvailable.
public void nullReturnedIfNoBindingAvailable() {
List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
assertThat(result).isNull();
result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
assertThat(result).isNull();
result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
assertThat(result).isNull();
}
use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.
the class SLOLocationTest method asynchronousBindingsAreNotReturnedWhenRequestingSynchronous.
public void asynchronousBindingsAreNotReturnedWhenRequestingSynchronous() {
List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
endpoints.add(endpointFor(HTTP_REDIRECT, "redirect"));
endpoints.add(endpointFor(HTTP_POST, "post"));
SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
assertThat(result).isNull();
}
use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.
the class SLOLocationTest method synchronousBindingReturnedIfNoAsynchronousAvailable.
public void synchronousBindingReturnedIfNoAsynchronousAvailable() {
List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
endpoints.add(endpointFor(SOAP, "soap"));
SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
assertThat(result.getBinding()).isEqualTo(SOAP);
result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
assertThat(result.getBinding()).isEqualTo(SOAP);
}
Aggregations