public class SpringTestHelper extends Object
Constructor and Description |
---|
SpringTestHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanContainerContext()
To be used only in TestNG tests when SpringContextRule can't be used.
|
static void |
mockContainerContext()
To be used only in TestNG tests when SpringContextRule can't be used.
|
static <T> T |
mockSpringComponent(@NotNull String componentKey,
@NotNull Class<T> componentClass)
Mock a component that could be accessed by ComponentAccessor or ContainerManager.
|
static void |
mockSpringComponent(@NotNull String componentKey,
@Nullable Object componentInstance)
Mock a component that could be accessed by ComponentAccessor or ContainerManager.
|
public static void mockContainerContext()
cleanContainerContext()
.public static void cleanContainerContext()
public static <T> T mockSpringComponent(@NotNull @NotNull String componentKey, @NotNull @NotNull Class<T> componentClass)
componentKey
- key of the componentcomponentClass
- class of componentpublic static void mockSpringComponent(@NotNull @NotNull String componentKey, @Nullable @Nullable Object componentInstance)
componentKey
- key of the componentcomponentInstance
- component itselfCopyright © 2024 Atlassian Software Systems Pty Ltd. All rights reserved.