-
- All Implemented Interfaces:
-
org.junit.rules.TestRule
public class TockJUnit4Rule<T extends TestContext> implements TestRuleA JUnit4 Rule to initialize the context for each call.
-
-
Field Summary
Fields Modifier and Type Field Description private final TtestContextprivate final BotDefinitionbotDefinitionprivate final TestLifecycle<T>lifecycle
-
Constructor Summary
Constructors Constructor Description TockJUnit4Rule(BotDefinition botDefinition, TestLifecycle<T> lifecycle)
-
Method Summary
Modifier and Type Method Description final BotBusMockstartNewBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)Provides a mock initialized with the specified StoryDefinition and starts the story. final BotBusMocknewBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)Provides a mock initialized with the specified StoryDefinition. final BotBusMockContextnewBusMockContext(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)Provides a mock context initialized with the specified StoryDefinition. final BotBusMockstartBusMock()Provides a mock context initialized with the current testContext and runs the bus. final BotBusMockbusMock()Provides a mock context initialized with the current testContext. Statementapply(Statement base, Description description)final TgetTestContext()final BotDefinitiongetBotDefinition()final TestLifecycle<T>getLifecycle()-
-
Constructor Detail
-
TockJUnit4Rule
TockJUnit4Rule(BotDefinition botDefinition, TestLifecycle<T> lifecycle)
-
-
Method Detail
-
startNewBusMock
final BotBusMock startNewBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)
Provides a mock initialized with the specified StoryDefinition and starts the story.
-
newBusMock
final BotBusMock newBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)
Provides a mock initialized with the specified StoryDefinition.
-
newBusMockContext
final BotBusMockContext newBusMockContext(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId)
Provides a mock context initialized with the specified StoryDefinition.
-
startBusMock
final BotBusMock startBusMock()
Provides a mock context initialized with the current testContext and runs the bus.
-
busMock
final BotBusMock busMock()
Provides a mock context initialized with the current testContext.
-
apply
Statement apply(Statement base, Description description)
-
getTestContext
final T getTestContext()
-
getBotDefinition
final BotDefinition getBotDefinition()
-
getLifecycle
final TestLifecycle<T> getLifecycle()
-
-
-
-