Class MockHttpChallengeContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext<O,F>
-
- net.officefloor.web.security.scheme.MockHttpChallengeContext<O,F>
-
- All Implemented Interfaces:
ChallengeContext<O,F>
,HttpChallenge
,HttpChallengeContext
,HttpSecurityActionContext
,HttpSecurityApplicationContext<O,F>
public class MockHttpChallengeContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends AbstractMockHttpSecurityActionContext<O,F> implements ChallengeContext<O,F>, HttpChallenge
MockChallengeContext
for testingHttpSecuritySource
instances.- Author:
- Daniel Sagenschneider
-
-
Field Summary
-
Fields inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
connection, dependencies, flows, requestState, session
-
-
Constructor Summary
Constructors Constructor Description MockHttpChallengeContext()
Initiate.MockHttpChallengeContext(ServerHttpConnection connection)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(java.lang.String name, java.lang.String value)
Adds a parameter to theHttpChallenge
.java.lang.String
getChallenge()
Obtains theWWW-Authenticate
challenge.HttpChallenge
setChallenge(java.lang.String authenticationScheme, java.lang.String realm)
Sets theHttpChallenge
.-
Methods inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
doFlow, getConnection, getObject, getQualifiedAttributeName, getRequestState, getSession, registerFlow, registerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.web.spi.security.HttpSecurityActionContext
getConnection, getQualifiedAttributeName, getRequestState, getSession
-
Methods inherited from interface net.officefloor.web.spi.security.HttpSecurityApplicationContext
doFlow, getObject
-
-
-
-
Constructor Detail
-
MockHttpChallengeContext
public MockHttpChallengeContext(ServerHttpConnection connection)
Initiate.- Parameters:
connection
-ServerHttpConnection
.
-
MockHttpChallengeContext
public MockHttpChallengeContext()
Initiate.
-
-
Method Detail
-
getChallenge
public java.lang.String getChallenge()
Obtains theWWW-Authenticate
challenge.- Returns:
- Challenge.
-
setChallenge
public HttpChallenge setChallenge(java.lang.String authenticationScheme, java.lang.String realm)
Description copied from interface:HttpChallengeContext
Sets the
HttpChallenge
.This should be used instead of directly adding the
HttpHeader
, so that can potentially include multipleHttpChallenge
instances.- Specified by:
setChallenge
in interfaceHttpChallengeContext
- Parameters:
authenticationScheme
- Authentication scheme.realm
- Realm.- Returns:
HttpChallenge
.
-
addParameter
public void addParameter(java.lang.String name, java.lang.String value)
Description copied from interface:HttpChallenge
Adds a parameter to theHttpChallenge
.- Specified by:
addParameter
in interfaceHttpChallenge
- Parameters:
name
- Parameter name.value
- Parameter value.
-
-