Search in sources :

Example 1 with BrowserLiveReloadAccessor

use of com.vaadin.flow.internal.BrowserLiveReloadAccessor in project flow by vaadin.

the class PushHandlerTest method mockBrowserLiveReloadImpl.

public static BrowserLiveReload mockBrowserLiveReloadImpl(VaadinContext context) {
    BrowserLiveReload liveReload = Mockito.mock(BrowserLiveReload.class);
    Lookup lookup = Lookup.of(new BrowserLiveReloadAccessor() {

        @Override
        public BrowserLiveReload getLiveReload(VaadinContext context) {
            return liveReload;
        }
    }, BrowserLiveReloadAccessor.class);
    context.setAttribute(Lookup.class, lookup);
    return liveReload;
}
Also used : VaadinContext(com.vaadin.flow.server.VaadinContext) BrowserLiveReload(com.vaadin.flow.internal.BrowserLiveReload) Lookup(com.vaadin.flow.di.Lookup) BrowserLiveReloadAccessor(com.vaadin.flow.internal.BrowserLiveReloadAccessor)

Aggregations

Lookup (com.vaadin.flow.di.Lookup)1 BrowserLiveReload (com.vaadin.flow.internal.BrowserLiveReload)1 BrowserLiveReloadAccessor (com.vaadin.flow.internal.BrowserLiveReloadAccessor)1 VaadinContext (com.vaadin.flow.server.VaadinContext)1