Class TockJUnit5ExtensionBase

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final T getTestContext()
      final BotDefinition getBotDefinition()
      final TestLifecycle<T> getLifecycle()
      final BotBusMock sendChoice(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests) Sends a choice and execute the tests.
      final BotBusMock sendMessage(IntentAware intent, Message message, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests) Sends a message and execute the tests.
      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.
      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.
      final BotBusMock send(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, ActionMetadata metadata, Function1<BotBusMock, Unit> tests) Sends a sentence and execute the tests.
      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.
      final Unit newChoiceRequest(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests) Creates a new choice request (not yet sent).
      final Unit newRequest(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests) Creates a new sentence request (not yet sent).
      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).
      final BotBusMock startNewBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId) Provides a mock initialized with the specified StoryDefinition and starts the story.
      final BotBusMock newBusMock(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId) Provides a mock initialized with the specified StoryDefinition.
      final BotBusMockContext newBusMockContext(StoryDefinition story, ConnectorType connectorType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, Action action, UserInterfaceType userInterfaceType, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes) Provides a mock context initialized with the specified StoryDefinition.
      final BotBusMock startBusMock() Provides a mock context initialized with the current testContext and runs the bus.
      final BotBusMock busMock() Provides a mock context initialized with the current testContext.
      Unit )>beforeEach(<Error class: unknown class> context)
      Unit )>afterEach(<Error class: unknown class> context)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TockJUnit5ExtensionBase

        TockJUnit5ExtensionBase(BotDefinition botDefinition, TestLifecycle<T> lifecycle)
    • Method Detail

      • sendChoice

         final BotBusMock sendChoice(IntentAware intent, Parameters parameters, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)

        Sends a choice and execute the tests.

        Parameters:
        intent - the intent triggered by the simulated button click
        parameters - the extra parameters associated with the simulated button click
        connectorType - the ConnectorType on which the simulated action happens
        userInterfaceType - the UserInterfaceType through which the simulated action happens
        locale - see BotBusMock.userLocale
        userId - see BotBusMock.userId
        botId - see BotBusMock.botId
        applicationId - see BotBusMock.applicationId
        userPreferences - see BotBusMock.userPreferences
        tests - a callback defining the assertions to execute after sending the choice
      • sendMessage

         final BotBusMock sendMessage(IntentAware intent, Message message, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)

        Sends a message and execute the tests.

        Parameters:
        intent - the intent triggered by the simulated message
        message - the user message - this message does not go through NLP
        connectorType - the ConnectorType on which the simulated action happens
        userInterfaceType - the UserInterfaceType through which the simulated action happens
        locale - see BotBusMock.userLocale
        userId - see BotBusMock.userId
        botId - see BotBusMock.botId
        applicationId - see BotBusMock.applicationId
        userPreferences - see BotBusMock.userPreferences
        tests - a callback containing the assertions to execute after sending the message
      • send

         final BotBusMock send(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes, ActionMetadata metadata, Function1<BotBusMock, Unit> tests)

        Sends a sentence and execute the tests.

        Parameters:
        text - the text sent by the user - this text does not go through NLP
        intent - the intent triggered by the text
        entities - the entities found in the text
        connectorType - the ConnectorType on which the simulated action happens
        userInterfaceType - the UserInterfaceType through which the simulated action happens
        locale - see BotBusMock.userLocale
        userId - see BotBusMock.userId
        botId - see BotBusMock.botId
        applicationId - see BotBusMock.applicationId
        userPreferences - see BotBusMock.userPreferences
        tests - a callback containing the assertions to execute after sending the text
      • 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, String applicationId, UserPreferences userPreferences, Function1<BotBusMock, Unit> tests)

        Creates a new choice request (not yet sent).

        Parameters:
        intent - the intent triggered by the simulated button click
        parameters - the extra parameters associated with the simulated button click
        connectorType - the ConnectorType on which the simulated action happens
        userInterfaceType - the UserInterfaceType through which the simulated action happens
        locale - see BotBusMock.userLocale
        userId - see BotBusMock.userId
        botId - see BotBusMock.botId
        applicationId - see BotBusMock.applicationId
        userPreferences - see BotBusMock.userPreferences
        tests - a callback containing the test code to execute in the context of the newly setup BotBusMock
      • newRequest

         final Unit newRequest(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, String applicationId, 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, String applicationId, Action action, UserInterfaceType userInterfaceType, UserPreferences userPreferences, List<ConnectorType> secondaryConnectorTypes)

        Provides a mock context initialized with the specified StoryDefinition.