protected void onAddContainer() { containerConfigPopup.show(translationService.getTranslation(ContainerConfigParamsPresenter_AddContainerPopupTitle), this::addContainer, () -> { }, getCurrentContainerNames()); }
@Before public void setUp() { when(configPresenter.getView()).thenReturn(configPresenterView); when(configPresenterView.getElement()).thenReturn(configPresenterViewElement); popup = new ContainerConfigPopup(basePopupView, configPresenter); popup.init(); verify(basePopupView, times(1)).init(popup); verify(basePopupView, times(1)).setContent(configPresenterViewElement); }
@Test public void testOnOKWhenInvalidConfig() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); when(configPresenter.validateForSubmit()).thenReturn(false); popup.onOK(); verify(configPresenter, times(1)).validateForSubmit(); verify(basePopupView, never()).hide(); verify(okCommand, never()).execute(any()); }
@Test public void testOnOKWhenInvalidConfig() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); when(configPresenter.validateForSubmit()).thenReturn(false); popup.onOK(); verify(configPresenter, times(1)).validateForSubmit(); verify(basePopupView, never()).hide(); verify(okCommand, never()).execute(any()); }
@Test public void testOnOKWhenValidConfig() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); ContainerConfig containerConfig = mock(ContainerConfig.class); when(configPresenter.getContainerConfig()).thenReturn(containerConfig); when(configPresenter.validateForSubmit()).thenReturn(true); popup.onOK(); verify(configPresenter, times(1)).validateForSubmit(); verify(basePopupView, times(1)).hide(); verify(okCommand, times(1)).execute(containerConfig); }
protected void onAddContainer() { containerConfigPopup.show(translationService.getTranslation(ContainerConfigParamsPresenter_AddContainerPopupTitle), this::addContainer, () -> { }, getCurrentContainerNames()); }
@Before public void setUp() { when(configPresenter.getView()).thenReturn(configPresenterView); when(configPresenterView.getElement()).thenReturn(configPresenterViewElement); popup = new ContainerConfigPopup(basePopupView, configPresenter); popup.init(); verify(basePopupView, times(1)).init(popup); verify(basePopupView, times(1)).setContent(configPresenterViewElement); }
@Test public void testOnOKWhenValidConfig() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); ContainerConfig containerConfig = mock(ContainerConfig.class); when(configPresenter.getContainerConfig()).thenReturn(containerConfig); when(configPresenter.validateForSubmit()).thenReturn(true); popup.onOK(); verify(configPresenter, times(1)).validateForSubmit(); verify(basePopupView, times(1)).hide(); verify(okCommand, times(1)).execute(containerConfig); }
private void prepareAndCallPopup() { when(translationService.getTranslation(ContainerConfigParamsPresenter_AddContainerPopupTitle)).thenReturn(TITLE); presenter.onAddContainer(); verify(containerConfigPopup, times(1)).show(eq(TITLE), okCommandCaptor.capture(), cancelCommandCaptor.capture(), anyList()); }
private void prepareAndCallPopup() { when(translationService.getTranslation(ContainerConfigParamsPresenter_AddContainerPopupTitle)).thenReturn(TITLE); presenter.onAddContainer(); verify(containerConfigPopup, times(1)).show(eq(TITLE), okCommandCaptor.capture(), cancelCommandCaptor.capture(), anyList()); }
@Test public void testShow() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); verify(configPresenter, times(1)).clear(); verify(configPresenter, times(1)).setup(alreadyInUseNames); verify(basePopupView, times(1)).show(TITLE); }
@Test public void testShow() { popup.show(TITLE, okCommand, cancelCommand, alreadyInUseNames); verify(configPresenter, times(1)).clear(); verify(configPresenter, times(1)).setup(alreadyInUseNames); verify(basePopupView, times(1)).show(TITLE); }