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 void
clearContext()
Clears the current context.SecurityContext
createEmptyContext()
Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.SecurityContext
getContext()
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
-
-
-
-
Method Detail
-
clearContext
public void clearContext()
Description copied from interface:SecurityContextHolderStrategy
Clears the current context.- Specified by:
clearContext
in interfaceSecurityContextHolderStrategy
-
getContext
public SecurityContext 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
public void setContext(SecurityContext context)
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
public SecurityContext 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.
-
-