Class MockedUI

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.UI
com.vaadin.browserless.mocks.MockedUI
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.PollNotifier, com.vaadin.flow.router.RouterLayout, Serializable

public class MockedUI extends com.vaadin.flow.component.UI
The UI the mocked environment creates by default.

It stands in for the browser in the two places the browser would normally act: it renders a navigation server-side, since there is no client router to hand the location to, and it flushes the state tree after a modality change, since there is no client response to trigger it.

The class is not final, so a test that needs a different UI can pass a factory producing a subclass, but the shape of what it overrides is not part of the published API.

For internal use only. May be renamed or removed in a future release.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.flow.component.UI

    com.vaadin.flow.component.UI.BrowserLeaveNavigationEvent, com.vaadin.flow.component.UI.BrowserNavigateEvent, com.vaadin.flow.component.UI.BrowserRefreshEvent, com.vaadin.flow.component.UI.ClientViewPlaceholder, com.vaadin.flow.component.UI.UiJs
  • Field Summary

    Fields inherited from class com.vaadin.flow.component.UI

    CLIENT_NAVIGATE_TO, wrapperElement
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the UI.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToModalComponent(com.vaadin.flow.component.Component component)
     
    void
    navigate(String locationString, com.vaadin.flow.router.QueryParameters queryParameters)
    Renders the route server side, as a test has no client router to hand the navigation to.
    void
    setChildComponentModal(com.vaadin.flow.component.Component childComponent, com.vaadin.flow.component.ModalityMode mode)
     

    Methods inherited from class com.vaadin.flow.component.UI

    access, accessLater, accessLater, accessSynchronously, add, addAfterNavigationListener, addBeforeEnterListener, addBeforeLeaveListener, addHeartbeatListener, addModal, addShortcutListener, addShortcutListener, beforeClientResponse, browserNavigate, close, doInit, getActiveDragSourceComponent, getActiveRouterTargetsChain, getActiveViewLocation, getChildren, getCsrfToken, getCurrent, getCurrentOrThrow, getCurrentView, getElement, getForwardToClientUrl, getInternals, getLastUpdateSentTimestamp, getLoadingIndicatorConfiguration, getLocale, getNavigationListeners, getPage, getPollInterval, getPushConfiguration, getReconnectDialogConfiguration, getSession, getSessionOrThrow, getUI, getUIId, hasModalComponent, init, isClosing, isNavigationSupported, leaveNavigation, localeSignal, navigate, navigate, navigate, navigate, navigate, navigate, navigate, navigate, navigateToClient, onAttach, onDetach, push, refreshCurrentRoute, routerStateSignal, setChildComponentModal, setCurrent, setDirection, setLocale, setPollInterval, triggerAfter

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttached

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasComponents

    add

    Methods inherited from interface com.vaadin.flow.component.HasComponentsOfType

    add, addComponentAsFirst, addComponentAtIndex, bindChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replace

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.PollNotifier

    addPollListener

    Methods inherited from interface com.vaadin.flow.router.RouterLayout

    removeRouterLayoutContent, showRouterLayoutContent
  • Constructor Details

    • MockedUI

      public MockedUI()
      Creates the UI.
  • Method Details

    • setChildComponentModal

      public void setChildComponentModal(com.vaadin.flow.component.Component childComponent, com.vaadin.flow.component.ModalityMode mode)
      Overrides:
      setChildComponentModal in class com.vaadin.flow.component.UI
    • addToModalComponent

      public void addToModalComponent(com.vaadin.flow.component.Component component)
      Overrides:
      addToModalComponent in class com.vaadin.flow.component.UI