Package 

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, AfterEachCallback
                        

    JUnit5 base extension.

    • Method Summary

      Modifier and Type Method Description
      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.
      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.
      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, UserPreferences userPreferences, 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, 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, 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, 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, Action action, UserInterfaceType userInterfaceType, UserPreferences userPreferences) 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(ExtensionContext context)
      Unit afterEach(ExtensionContext context)
      final T getTestContext()
      final BotDefinition getBotDefinition()
      final TestLifecycle<T> getLifecycle()
      • Methods inherited from class org.junit.jupiter.api.extension.Extension

        equals, hashCode, toString
      • 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, 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.

      • send

         final BotBusMock send(String text, IntentAware intent, EntityValue entities, ConnectorType connectorType, UserInterfaceType userInterfaceType, Locale locale, PlayerId userId, PlayerId botId, UserPreferences userPreferences, 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, 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)

        Provides a mock context initialized with the specified StoryDefinition.