Class TestSecurityContextHolderStrategyAdapter
- java.lang.Object
-
- org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
-
- All Implemented Interfaces:
SecurityContextHolderStrategy
public final class TestSecurityContextHolderStrategyAdapter extends java.lang.Object implements SecurityContextHolderStrategy
-
-
Constructor Summary
Constructors Constructor Description TestSecurityContextHolderStrategyAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearContext()Clears the current context.SecurityContextcreateEmptyContext()Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.SecurityContextgetContext()Obtains the current context.voidsetContext(SecurityContext context)Sets the current context.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.security.core.context.SecurityContextHolderStrategy
getDeferredContext, setDeferredContext
-
-
-
-
Method Detail
-
clearContext
public void clearContext()
Description copied from interface:SecurityContextHolderStrategyClears the current context.- Specified by:
clearContextin interfaceSecurityContextHolderStrategy
-
getContext
public SecurityContext getContext()
Description copied from interface:SecurityContextHolderStrategyObtains the current context.- Specified by:
getContextin interfaceSecurityContextHolderStrategy- Returns:
- a context (never
null- create a default implementation if necessary)
-
setContext
public void setContext(SecurityContext context)
Description copied from interface:SecurityContextHolderStrategySets the current context.- Specified by:
setContextin interfaceSecurityContextHolderStrategy- Parameters:
context- to the new argument (should never benull, although implementations must check ifnullhas been passed and throw anIllegalArgumentExceptionin such cases)
-
createEmptyContext
public SecurityContext createEmptyContext()
Description copied from interface:SecurityContextHolderStrategyCreates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.- Specified by:
createEmptyContextin interfaceSecurityContextHolderStrategy- Returns:
- the empty context.
-
-