@Test(expected = ConfigurationException.class) public void changeView_RootComponentNotSet() { // given when(toView.getRootComponent()).thenReturn(null); when(toView.getName()).thenReturn("toView"); // when ui.changeView(toView); // then }
@Test public void changeView() { // given when(toView.getRootComponent()).thenReturn(viewContent); when(toView.getName()).thenReturn("toView"); // when ui.changeView(toView); // then verify(toView).getRootComponent(); verify(translator).translate(toView); verify(viewContent).setSizeFull(); assertThat(ui.getViewDisplayPanel().getContent()).isEqualTo(viewContent); }