use of com.vaadin.flow.server.startup.ApplicationConfiguration in project flow by vaadin.
the class SpringClassesSerializableTest method createStore.
private TestBeanStore createStore() {
final Properties initParameters = new Properties();
ApplicationConfiguration appConfig = Mockito.mock(ApplicationConfiguration.class);
Mockito.when(appConfig.getPropertyNames()).thenReturn(Collections.emptyEnumeration());
VaadinContext context = Mockito.mock(VaadinContext.class);
Mockito.when(context.getAttribute(Mockito.eq(ApplicationConfiguration.class), Mockito.any())).thenReturn(appConfig);
Mockito.when(appConfig.getContext()).thenReturn(context);
Lookup lookup = Mockito.mock(Lookup.class);
Mockito.when(context.getAttribute(Lookup.class)).thenReturn(lookup);
VaadinService service = new VaadinServletService(new VaadinServlet(), new DefaultDeploymentConfiguration(appConfig, getClass(), initParameters)) {
@Override
public VaadinContext getContext() {
return context;
}
};
VaadinSession session = new TestSession(service);
TestBeanStore store = new TestBeanStore(session);
return store;
}
Aggregations