Class TockJUnit5ExtensionBase
-
- All Implemented Interfaces:
-
org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
public class TockJUnit5ExtensionBase<T extends TestContext> implements BeforeEachCallback, AfterEachCallbackJUnit5 base extension.
-
-
Field Summary
Fields Modifier and Type Field Description private final TtestContextprivate final BotDefinitionbotDefinitionprivate final TestLifecycle<T>lifecycle
-
Constructor Summary
Constructors Constructor Description TockJUnit5ExtensionBase(BotDefinition botDefinition, TestLifecycle<T> lifecycle)
-
Method Summary
Modifier and Type Method Description final TgetTestContext()final BotDefinitiongetBotDefinition()final TestLifecycle<T>getLifecycle()final BotBusMocksendChoice(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)Sends a choice and execute the tests. final BotBusMocksendMessage(IntentAware intent, Message message, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)Sends a message and execute the tests. final BotBusMockselectChoice(BotBusMockLog busMockLog, String buttonTitle, Function1<BotBusMock, Unit> tests)Sends a message simulating a click on action of a previous bus log and execute the tests. final BotBusMockselectElementChoice(BotBusMockLog busMockLog, Integer elementIndex, String buttonTitle, Function1<BotBusMock, Unit> tests)Sends a message simulating a click on action of an element in previous bus log and execute the tests. final BotBusMocksend(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, ActionMetadata metadata, Function1<BotBusMock, Unit> tests)Sends a sentence and execute the tests. final BotBusMocksend(IntentAware intent, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, Function0<Action> actionProvider, Function1<BotBusMock, Unit> tests)Sends an action and execute the tests. final UnitnewChoiceRequest(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)Creates a new choice request (not yet sent). final UnitnewRequest(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)Creates a new sentence request (not yet sent). final UnitnewRequest(IntentAware intent, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function0<Action> actionProvider, Function1<BotBusMock, Unit> tests)Creates a new action request (not yet sent). 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, PlayerId botId, Action action, UserInterfaceType userInterfaceType, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes)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. UnitbeforeEach(ExtensionContext context)UnitafterEach(ExtensionContext context)-
-
Constructor Detail
-
TockJUnit5ExtensionBase
TockJUnit5ExtensionBase(BotDefinition botDefinition, TestLifecycle<T> lifecycle)
-
-
Method Detail
-
getTestContext
final T getTestContext()
-
getBotDefinition
final BotDefinition getBotDefinition()
-
getLifecycle
final TestLifecycle<T> getLifecycle()
-
sendChoice
final BotBusMock sendChoice(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)
Sends a choice and execute the tests.
-
sendMessage
final BotBusMock sendMessage(IntentAware intent, Message message, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)
Sends a message and execute the tests.
-
selectChoice
final BotBusMock selectChoice(BotBusMockLog busMockLog, String buttonTitle, Function1<BotBusMock, Unit> tests)
Sends a message simulating a click on action of a previous bus log and execute the tests.
-
selectElementChoice
final BotBusMock selectElementChoice(BotBusMockLog busMockLog, Integer elementIndex, String buttonTitle, Function1<BotBusMock, Unit> tests)
Sends a message simulating a click on action of an element in previous bus log and execute the tests.
-
send
final BotBusMock send(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, ActionMetadata metadata, Function1<BotBusMock, Unit> tests)
Sends a sentence and execute the tests.
-
send
final BotBusMock send(IntentAware intent, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, Function0<Action> actionProvider, Function1<BotBusMock, Unit> tests)
Sends an action and execute the tests.
-
newChoiceRequest
final Unit newChoiceRequest(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)
Creates a new choice request (not yet sent).
-
newRequest
final Unit newRequest(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)
Creates a new sentence request (not yet sent).
-
newRequest
final Unit newRequest(IntentAware intent, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, Function0<Action> actionProvider, Function1<BotBusMock, Unit> tests)
Creates a new action request (not yet sent).
-
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, PlayerId botId, Action action, UserInterfaceType userInterfaceType, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes)
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.
-
beforeEach
Unit beforeEach(ExtensionContext context)
-
-
-
-