Class TestSecurityContextHolderStrategyAdapter
java.lang.Object
org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
- All Implemented Interfaces:
SecurityContextHolderStrategy
public final class TestSecurityContextHolderStrategyAdapter
extends Object
implements SecurityContextHolderStrategy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the current context.Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.Obtains the current context.void
setContext
(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
-
Constructor Details
-
TestSecurityContextHolderStrategyAdapter
public TestSecurityContextHolderStrategyAdapter()
-
-
Method Details
-
clearContext
public void clearContext()Description copied from interface:SecurityContextHolderStrategy
Clears the current context.- Specified by:
clearContext
in interfaceSecurityContextHolderStrategy
-
getContext
Description copied from interface:SecurityContextHolderStrategy
Obtains the current context.- Specified by:
getContext
in interfaceSecurityContextHolderStrategy
- Returns:
- a context (never
null
- create a default implementation if necessary)
-
setContext
Description copied from interface:SecurityContextHolderStrategy
Sets the current context.- Specified by:
setContext
in interfaceSecurityContextHolderStrategy
- Parameters:
context
- to the new argument (should never benull
, although implementations must check ifnull
has been passed and throw anIllegalArgumentException
in such cases)
-
createEmptyContext
Description copied from interface:SecurityContextHolderStrategy
Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.- Specified by:
createEmptyContext
in interfaceSecurityContextHolderStrategy
- Returns:
- the empty context.
-