use of de.symeda.sormas.ui.utils.SormasDefaultConverterFactory in project SORMAS-Project by hzi-braunschweig.
the class CaseControllerTest method initUI.
@Before
public void initUI() throws Exception {
creator.createUser(null, null, null, "ad", "min", UserRole.ADMIN, UserRole.NATIONAL_USER);
VaadinRequest request = Mockito.mock(VaadinServletRequest.class);
when(request.getUserPrincipal()).thenReturn((Principal) () -> "admin");
CurrentInstance.set(VaadinRequest.class, request);
VaadinService service = Mockito.mock(VaadinService.class);
CurrentInstance.set(VaadinService.class, service);
VaadinSession session = Mockito.mock(VaadinSession.class);
ConverterFactory converterFactory = new SormasDefaultConverterFactory();
when(session.getConverterFactory()).thenReturn(converterFactory);
when(session.getService()).thenReturn(service);
CurrentInstance.set(VaadinSession.class, session);
ui = new SormasUI();
CurrentInstance.set(UI.class, ui);
java.lang.reflect.Field pageField = UI.class.getDeclaredField("page");
pageField.setAccessible(true);
pageField.set(ui, Mockito.mock(Page.class));
}
use of de.symeda.sormas.ui.utils.SormasDefaultConverterFactory in project SORMAS-Project by hzi-braunschweig.
the class LoginUI method init.
@Override
public void init(VaadinRequest vaadinRequest) {
setErrorHandler(SormasErrorHandler.get());
setLocale(vaadinRequest.getLocale());
Responsive.makeResponsive(this);
VaadinSession.getCurrent().setConverterFactory(new SormasDefaultConverterFactory());
getPage().setTitle(FacadeProvider.getConfigFacade().getSormasInstanceName());
setContent(new LoginScreen(DefaultPasswordUIHelper.getInterceptionLoginListener((LoginListener) () -> UI.getCurrent().getPage().setLocation(VaadinServletService.getCurrentServletRequest().getContextPath() + "#" + DataHelper.toStringNullable(UI.getCurrent().getPage().getUriFragment())), UI.getCurrent())));
}
use of de.symeda.sormas.ui.utils.SormasDefaultConverterFactory in project SORMAS-Project by hzi-braunschweig.
the class SormasUI method init.
@Override
public void init(VaadinRequest vaadinRequest) {
setErrorHandler(SormasErrorHandler.get());
setLocale(vaadinRequest.getLocale());
Responsive.makeResponsive(this);
VaadinSession.getCurrent().setConverterFactory(new SormasDefaultConverterFactory());
getPage().setTitle(FacadeProvider.getConfigFacade().getSormasInstanceName());
initMainScreen();
}
Aggregations