ActivityNotFoundPresenter { @OnClose public void onClose() { final String identifier = place.getParameter("requestedPlaceIdentifier", null); if (identifier != null) { placeManager.forceClosePlace(identifier); } } @Inject  ActivityNotFoundPresenter(final ActivityNotFoundView view, final PlaceManager placeManager); @WorkbenchPartTitle String getTitle(); @OnStartup void onStartup(final PlaceRequest place); @OnClose void onClose(); @WorkbenchPartView UberView<ActivityNotFoundPresenter> getView();  }
@Test public void testOnCloseNullPlaceIdentifier() { presenter.onClose(); verifyZeroInteractions(placeManager); }
@Test public void testOnCloseNonNullPlaceIdentifier() { final String placeIdentifier = "screen-id"; when(placeRequest.getParameter("requestedPlaceIdentifier", null)).thenReturn(placeIdentifier); presenter.onClose(); verify(placeManager).forceClosePlace(placeIdentifier); }