Class MockHttpAuthenticateContext<AC extends Serializable,O extends Enum<O>,F extends Enum<F>>
java.lang.Object
net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext<O,F>
net.officefloor.web.security.scheme.MockHttpAuthenticateContext<AC,O,F>
- All Implemented Interfaces:
AccessControlListener<AC>,AuthenticateContext<AC,,O, F> HttpSecurityActionContext,HttpSecurityApplicationContext<O,F>
public class MockHttpAuthenticateContext<AC extends Serializable,O extends Enum<O>,F extends Enum<F>>
extends AbstractMockHttpSecurityActionContext<O,F>
implements AuthenticateContext<AC,O,F>
Mock
AuthenticateContext for testing HttpSecuritySource
instances.- Author:
- Daniel Sagenschneider
-
Field Summary
Fields inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
connection, dependencies, flows, requestState, session -
Constructor Summary
ConstructorsConstructorDescriptionInitiate with noauthorizationHttpHeader.MockHttpAuthenticateContext(String authorizationHeaderValue) Initiate.MockHttpAuthenticateContext(ServerHttpConnection connection) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessControlChange(AC accessControl, Throwable escalation) Notified of a change to access control.static ServerHttpConnectioncreateRequestWithAuthorizationHeader(String authorizationHeaderValue) Creates theServerHttpConnectionwith authorizationHttpHeadervalue.Obtains the registered access control.Obtains the registered escalation.Methods inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
doFlow, getConnection, getObject, getQualifiedAttributeName, getRequestState, getSession, registerFlow, registerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.web.spi.security.HttpSecurityActionContext
getConnection, getQualifiedAttributeName, getRequestState, getSessionMethods inherited from interface net.officefloor.web.spi.security.HttpSecurityApplicationContext
doFlow, getObject
-
Constructor Details
-
MockHttpAuthenticateContext
public MockHttpAuthenticateContext()Initiate with noauthorizationHttpHeader. -
MockHttpAuthenticateContext
Initiate.- Parameters:
authorizationHeaderValue-authorizationHttpHeadervalue.
-
MockHttpAuthenticateContext
Initiate.- Parameters:
connection-ServerHttpConnection.
-
-
Method Details
-
createRequestWithAuthorizationHeader
public static ServerHttpConnection createRequestWithAuthorizationHeader(String authorizationHeaderValue) Creates theServerHttpConnectionwith authorizationHttpHeadervalue.- Parameters:
authorizationHeaderValue- AuthorizationHttpHeadervalue.- Returns:
ServerHttpConnection.
-
getAccessControl
Obtains the registered access control.- Returns:
- Access control.
-
getEscalation
Obtains the registered escalation.- Returns:
- Escalation.
-
accessControlChange
Description copied from interface:AccessControlListenerNotified of a change to access control.- Specified by:
accessControlChangein interfaceAccessControlListener<AC extends Serializable>- Parameters:
accessControl- Access control. May benullif- logging out
- failure in authenticating
escalation- PossibleEscalation. Will benullif successfully obtain access control or logout.
-