public BotBusMock(@NotNull
BotBusMockContext context,
@NotNull
ai.tock.bot.engine.action.Action action)
A Bus mock used in unit tests.
The answers of the bot are available in the answers property.
answers@NotNull public java.util.List<ai.tock.bot.test.BotBusMockLog> getAnswers()
The list of all bot answers recorded.
@NotNull public BotBusMockLog getFirstAnswer()
The first answer recorded.
@NotNull public BotBusMockLog getSecondAnswer()
The second answer recorded.
@NotNull public BotBusMockLog getThirdAnswer()
The third answer recorded.
@NotNull public BotBusMockLog getLastAnswer()
The last answer recorded.
@NotNull public java.util.List<ai.tock.bot.test.BotBusMockLog> getBusAnswers()
The list of bot answers for this bus.
@NotNull public BotBusMockLog getFirstBusAnswer()
The first answer for this bus.
@NotNull public BotBusMockLog getSecondBusAnswer()
The second answer for this bus.
@NotNull public BotBusMockLog getThirdBusAnswer()
The third answer for this bus.
@NotNull public BotBusMockLog getLastBusAnswer()
The last answer for this bus.
public int getCurrentAnswerIndex()
@NotNull public BotBusMock run()
Run the StoryHandler of the current story.
story@NotNull public BotBusMock checkEndCalled()
Throws an exception if the end() is not called
@NotNull public BotBusMock addActionEntity(@NotNull ai.tock.bot.engine.dialog.EntityValue contextValue)
Add an entity set in the current action.
@NotNull public BotBusMock addActionEntity(@NotNull ai.tock.nlp.api.client.model.Entity entity, @Nullable ai.tock.nlp.entity.Value newValue)
Add an entity set in the current action.
@NotNull public BotBusMock addActionEntity(@NotNull ai.tock.nlp.api.client.model.Entity entity, @NotNull java.lang.String textContent)
Simulate an action entity.
@NotNull public ai.tock.bot.engine.user.UserTimeline getUserTimeline()
public void setUserTimeline(@NotNull
ai.tock.bot.engine.user.UserTimeline value)
@NotNull public ai.tock.bot.engine.dialog.Dialog getDialog()
public void setDialog(@NotNull
ai.tock.bot.engine.dialog.Dialog value)
@NotNull public ai.tock.bot.engine.dialog.Story getStory()
public void setStory(@NotNull
ai.tock.bot.engine.dialog.Story value)
@NotNull public ai.tock.bot.definition.BotDefinition getBotDefinition()
public void setBotDefinition(@NotNull
ai.tock.bot.definition.BotDefinition value)
@NotNull public ai.tock.translator.I18nKeyProvider getI18nProvider()
public void setI18nProvider(@NotNull
ai.tock.translator.I18nKeyProvider value)
@NotNull public ai.tock.translator.UserInterfaceType getUserInterfaceType()
public void setUserInterfaceType(@NotNull
ai.tock.translator.UserInterfaceType value)
@NotNull public ai.tock.bot.connector.ConnectorType getConnectorType()
public void setConnectorType(@NotNull
ai.tock.bot.connector.ConnectorType value)
@NotNull public ai.tock.bot.connector.ConnectorData getConnectorData()
public void setConnectorData(@NotNull
ai.tock.bot.connector.ConnectorData p)
@NotNull public ai.tock.translator.TranslatorEngine getTranslator()
The translator used to translate labels - default is NoOp.
@NotNull public java.lang.String getApplicationId()
@NotNull public ai.tock.bot.engine.user.PlayerId getBotId()
@NotNull public ai.tock.bot.engine.user.PlayerId getUserId()
@NotNull public ai.tock.bot.engine.user.UserPreferences getUserPreferences()
@NotNull public java.util.Locale getUserLocale()
@NotNull public ai.tock.bot.connector.ConnectorType getTargetConnectorType()
public void setTargetConnectorType(@NotNull
ai.tock.bot.connector.ConnectorType value)
@NotNull public ai.tock.bot.connector.Connector getUnderlyingConnector()
@NotNull public java.util.Map<java.lang.String,ai.tock.bot.engine.dialog.EntityStateValue> getEntities()
@Nullable public ai.tock.bot.definition.IntentAware getIntent()
public void setIntent(@Nullable
ai.tock.bot.definition.IntentAware value)
@Nullable public ai.tock.bot.engine.dialog.NextUserActionState getNextUserActionState()
public void setNextUserActionState(@Nullable
ai.tock.bot.engine.dialog.NextUserActionState value)
public void sendAction(@NotNull
ai.tock.bot.engine.action.Action action,
long delay)
@Nullable
public <T> T getBusContextValue(@NotNull
java.lang.String name)
Returns the non persistent current value.
public void setBusContextValue(@NotNull
java.lang.String key,
@Nullable
java.lang.Object value)
Update the non persistent current value.
@NotNull
public ai.tock.bot.engine.BotBus end(@NotNull
ai.tock.bot.engine.action.Action action,
long delay)
@NotNull
public ai.tock.bot.engine.action.SendSentence createBotSentence(@Nullable
java.lang.CharSequence plainText)
@NotNull
public ai.tock.bot.engine.BotBus sendRawText(@Nullable
java.lang.CharSequence plainText,
long delay)
@NotNull
public ai.tock.bot.engine.BotBus send(@NotNull
ai.tock.bot.engine.action.Action action,
long delay)
@NotNull
public ai.tock.bot.engine.BotBus withPriority(@NotNull
ai.tock.bot.engine.action.ActionPriority priority)
@NotNull
public ai.tock.bot.engine.BotBus withNotificationType(@NotNull
ai.tock.bot.engine.action.ActionNotificationType notificationType)
@NotNull
public ai.tock.bot.engine.BotBus withVisibility(@NotNull
ai.tock.bot.engine.action.ActionVisibility visibility)
@NotNull
public ai.tock.bot.engine.BotBus withMessage(@NotNull
ai.tock.bot.connector.ConnectorType connectorType,
@NotNull
kotlin.jvm.functions.Function0<? extends ai.tock.bot.connector.ConnectorMessage> messageProvider)
@NotNull
public ai.tock.bot.engine.BotBus withMessage(@NotNull
ai.tock.bot.connector.ConnectorType connectorType,
@NotNull
java.lang.String connectorId,
@NotNull
kotlin.jvm.functions.Function0<? extends ai.tock.bot.connector.ConnectorMessage> messageProvider)
public void reloadProfile()
@NotNull
public ai.tock.translator.TranslatedSequence translate(@Nullable
ai.tock.translator.I18nLabelValue key)
public void markAsUnknown()
@NotNull
public ai.tock.bot.engine.action.Action applyBotAnswerInterceptor(@NotNull
ai.tock.bot.engine.action.Action a)
Update Action using BotAnswerInterceptor
@NotNull public BotBusMockContext getContext()
@NotNull public ai.tock.bot.engine.action.Action getAction()