BaseView extends VerticalLayout implements BeforeLeaveObserver { protected String message(String key) { return messageService.getMessage(key, VaadinUtils.getLocale()); } BaseView(boolean confirmBeforeLeave);  BaseView(); @PostConstruct final void init(); MessageService getMessageService(); EntityModelFactory getModelFactory(); UIHelper getUiHelper(); @Override void beforeLeave(BeforeLeaveEvent event); static final String SELECTED_ID; }
@Test public void testMessage() { view.message("key"); verify(messageService).getMessage(eq("key"), any(Locale.class)); }
@Test public void testMessageWithPars() { view.message("key", "bob"); verify(messageService).getMessage(eq("key"), any(Locale.class), eq("bob")); }