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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears 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.voidsetContext(SecurityContext context) Sets the current context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SecurityContextHolderStrategyClears the current context.- Specified by:
clearContextin interfaceSecurityContextHolderStrategy
-
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
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
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.
-