public void closeFirstPartAndAddNewOne(Command command) { placeManager.tryClosePlace(getPlaceFromFirstPart(), command); }
void newDataSet() { placeManager.tryClosePlace(new DefaultPlaceRequest("DataSetDefWizard"), () -> { placeManager.goTo("DataSetDefWizard"); }); }
void newDataSet() { placeManager.tryClosePlace(new DefaultPlaceRequest("DataSetDefWizard"), () -> { placeManager.goTo("DataSetDefWizard"); }); }
@Test public void testNewDataSet() { presenter.newDataSet(); verify(placeManager).tryClosePlace(eq(new DefaultPlaceRequest("DataSetDefWizard")), any(Command.class)); verify(placeManager).goTo("DataSetDefWizard"); }
@Test public void closeFirstPartAndAddNewOneTest() { PlaceRequest place = mock(PlaceRequest.class); PartDefinition part = mock(PartDefinition.class); Command cmd = mock(Command.class); when(part.getPlace()).thenReturn(place); Collection<PartDefinition> parts = Arrays.asList(part); singlePartHelper = new SinglePartPanelHelper(parts, placeManager); singlePartHelper.closeFirstPartAndAddNewOne(cmd); verify(placeManager).tryClosePlace(place, cmd); } }
@Test public void testNewDataSet() { presenter.newDataSet(); verify(placeManager).tryClosePlace(eq(new DefaultPlaceRequest("DataSetDefWizard")), any(Command.class)); verify(placeManager).goTo("DataSetDefWizard"); }
@Test public void closeFirstPartAndAddNewOneTest() { PlaceRequest place = mock(PlaceRequest.class); PartDefinition part = mock(PartDefinition.class); Command cmd = mock(Command.class); when(part.getPlace()).thenReturn(place); Collection<PartDefinition> parts = Arrays.asList(part); singlePartHelper = new SinglePartPanelHelper(parts, placeManager); singlePartHelper.closeFirstPartAndAddNewOne(cmd); verify(placeManager).tryClosePlace(place, cmd); } }
@Before public void setup() throws Exception { presenter.services = services; assertEquals(explorerWidget, presenter.getView()); doAnswer(invocationOnMock -> { Command callback = (Command ) invocationOnMock.getArguments()[1]; callback.execute(); return null; }).when(placeManager).tryClosePlace(any(), any()); doAnswer(invocationOnMock -> { RemoteCallback callback = (RemoteCallback) invocationOnMock.getArguments()[0]; callback.callback(mock(Path.class)); return null; }).when(services).call(any(RemoteCallback.class)); }
@Before public void setup() throws Exception { presenter.services = services; assertEquals(explorerWidget, presenter.getView()); doAnswer(invocationOnMock -> { Command callback = (Command ) invocationOnMock.getArguments()[1]; callback.execute(); return null; }).when(placeManager).tryClosePlace(any(), any()); doAnswer(invocationOnMock -> { RemoteCallback callback = (RemoteCallback) invocationOnMock.getArguments()[0]; callback.callback(mock(Path.class)); return null; }).when(services).call(any(RemoteCallback.class)); }