public void testDefaultProfileOptions() throws Exception {
expect(request.getParameter("idp")).andReturn("http://localhost:8080/opensso").anyTimes();
replayMock();
WebSSOProfileOptions defaultOptions = new WebSSOProfileOptions();
defaultOptions.setProxyCount(0);
defaultOptions.setIncludeScoping(false);
defaultOptions.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
// Set default values
entryPoint.setDefaultProfileOptions(defaultOptions);
// Check that default values are used
WebSSOProfileOptions ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
assertEquals(new Integer(0), ssoProfileOptions.getProxyCount());
assertFalse(ssoProfileOptions.isIncludeScoping());
assertFalse(ssoProfileOptions.getForceAuthN());
assertFalse(ssoProfileOptions.getPassive());
assertEquals(SAMLConstants.SAML2_REDIRECT_BINDING_URI, ssoProfileOptions.getBinding());
// Check that value can't be altered after being set
defaultOptions.setIncludeScoping(true);
ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
assertFalse(ssoProfileOptions.isIncludeScoping());
// Check that default values can be cleared
entryPoint.setDefaultProfileOptions(null);
ssoProfileOptions = entryPoint.getProfileOptions(new SAMLMessageContext(), null);
assertTrue(ssoProfileOptions.isIncludeScoping());
verifyMock();
}