public class TockJUnit5ExtensionBase<T extends TestContext>
JUnit5 base extension.
public static ai.tock.bot.test.junit.TockJUnit5ExtensionBase.Companion Companion
public TockJUnit5ExtensionBase(@NotNull
ai.tock.bot.definition.BotDefinition botDefinition,
@NotNull
TestLifecycle<? extends T> lifecycle)
JUnit5 base extension.
@NotNull public T getTestContext()
The class TestContext.
class TestContext@NotNull public BotBusMock sendChoice(@NotNull ai.tock.bot.definition.IntentAware intent, @NotNull ai.tock.bot.definition.Parameters parameters, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId, @NotNull ai.tock.bot.engine.user.PlayerId botId, @NotNull ai.tock.bot.engine.user.UserPreferences userPreferences, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends a choice and execute the tests.
@NotNull public BotBusMock sendMessage(@NotNull ai.tock.bot.definition.IntentAware intent, @NotNull ai.tock.bot.engine.message.Message message, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId, @NotNull ai.tock.bot.engine.user.PlayerId botId, @NotNull ai.tock.bot.engine.user.UserPreferences userPreferences, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends a message and execute the tests.
@NotNull public BotBusMock selectChoice(@NotNull BotBusMockLog busMockLog, @NotNull java.lang.String buttonTitle, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends a message simulating a click on action of a previous bus log and execute the tests.
@NotNull public BotBusMock selectElementChoice(@NotNull BotBusMockLog busMockLog, int elementIndex, @NotNull java.lang.String buttonTitle, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends a message simulating a click on action of an element in previous bus log and execute the tests.
@NotNull public BotBusMock send(@NotNull java.lang.String text, @NotNull ai.tock.bot.definition.IntentAware intent, @NotNull ai.tock.bot.engine.dialog.EntityValue[] entities, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId, @NotNull ai.tock.bot.engine.user.PlayerId botId, @NotNull ai.tock.bot.engine.user.UserPreferences userPreferences, @NotNull ai.tock.bot.engine.action.ActionMetadata metadata, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends a sentence and execute the tests.
@NotNull public BotBusMock send(@NotNull ai.tock.bot.definition.IntentAware intent, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId, @NotNull ai.tock.bot.engine.user.PlayerId botId, @NotNull ai.tock.bot.engine.user.UserPreferences userPreferences, @NotNull kotlin.jvm.functions.Function0<? extends ai.tock.bot.engine.action.Action> actionProvider, @NotNull kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Sends an action and execute the tests.
public void newChoiceRequest(@NotNull
ai.tock.bot.definition.IntentAware intent,
@NotNull
ai.tock.bot.definition.Parameters parameters,
@NotNull
ai.tock.bot.connector.ConnectorType connectorType,
@NotNull
ai.tock.translator.UserInterfaceType userInterfaceType,
@NotNull
java.util.Locale locale,
@NotNull
ai.tock.bot.engine.user.PlayerId userId,
@NotNull
ai.tock.bot.engine.user.PlayerId botId,
@NotNull
ai.tock.bot.engine.user.UserPreferences userPreferences,
@NotNull
kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Creates a new choice request (not yet sent).
public void newRequest(@NotNull
java.lang.String text,
@NotNull
ai.tock.bot.definition.IntentAware intent,
@NotNull
ai.tock.bot.engine.dialog.EntityValue[] entities,
@NotNull
ai.tock.bot.connector.ConnectorType connectorType,
@NotNull
ai.tock.translator.UserInterfaceType userInterfaceType,
@NotNull
java.util.Locale locale,
@NotNull
ai.tock.bot.engine.user.PlayerId userId,
@NotNull
ai.tock.bot.engine.user.PlayerId botId,
@NotNull
ai.tock.bot.engine.user.UserPreferences userPreferences,
@NotNull
kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Creates a new sentence request (not yet sent).
public void newRequest(@NotNull
ai.tock.bot.definition.IntentAware intent,
@NotNull
ai.tock.bot.connector.ConnectorType connectorType,
@NotNull
ai.tock.translator.UserInterfaceType userInterfaceType,
@NotNull
java.util.Locale locale,
@NotNull
ai.tock.bot.engine.user.PlayerId userId,
@NotNull
ai.tock.bot.engine.user.PlayerId botId,
@NotNull
ai.tock.bot.engine.user.UserPreferences userPreferences,
@NotNull
kotlin.jvm.functions.Function0<? extends ai.tock.bot.engine.action.Action> actionProvider,
@NotNull
kotlin.jvm.functions.Function1<? super ai.tock.bot.test.BotBusMock,kotlin.Unit> tests)
Creates a new action request (not yet sent).
@NotNull public BotBusMock startNewBusMock(@NotNull ai.tock.bot.definition.StoryDefinition story, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId)
Provides a mock initialized with the specified StoryDefinition and starts the story.
@NotNull public BotBusMock newBusMock(@NotNull ai.tock.bot.definition.StoryDefinition story, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId)
Provides a mock initialized with the specified StoryDefinition.
@NotNull public BotBusMockContext newBusMockContext(@NotNull ai.tock.bot.definition.StoryDefinition story, @NotNull ai.tock.bot.connector.ConnectorType connectorType, @NotNull java.util.Locale locale, @NotNull ai.tock.bot.engine.user.PlayerId userId, @NotNull ai.tock.bot.engine.user.PlayerId botId, @NotNull ai.tock.bot.engine.action.Action action, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @NotNull ai.tock.bot.engine.user.UserPreferences userPreferences)
Provides a mock context initialized with the specified StoryDefinition.
@NotNull public BotBusMock startBusMock()
Provides a mock context initialized with the current testContext and runs the bus.
testContext@NotNull public BotBusMock busMock()
Provides a mock context initialized with the current testContext.
testContextpublic void beforeEach(@NotNull
org.junit.jupiter.api.extension.ExtensionContext context)
public void afterEach(@NotNull
org.junit.jupiter.api.extension.ExtensionContext context)
@NotNull public ai.tock.bot.definition.BotDefinition getBotDefinition()
@NotNull public TestLifecycle<T> getLifecycle()