@Test public void preDestroyVisualDiffOnlyLeftTest() throws NoSuchFieldException { new FieldSetter(presenter, DiffItemPresenter.class.getDeclaredField("diffMode")).set(DiffMode.VISUAL); new FieldSetter(presenter, DiffItemPresenter.class.getDeclaredField("placeRequestCustomLeft")) .set(mock(PlaceRequest.class)); new FieldSetter(presenter, DiffItemPresenter.class.getDeclaredField("ready")).set(true); new FieldSetter(presenter, DiffItemPresenter.class.getDeclaredField("open")).set(true); presenter.preDestroy(); verify(placeManager).closePlace(any(PlaceRequest.class)); }
@PreDestroy public void preDestroy() { if (ready && open) { closeContent(); } }
DiffItemPresenter { @PreDestroy public void preDestroy() { if (ready && open) { closeContent(); } } }
DiffItemPresenter { @PreDestroy public void preDestroy() { if (ready && open) { closeContent(); } } @Inject  DiffItemPresenter(final View view,
                             final ResourceTypeManagerCache resourceTypeManagerCache,
                             final PlaceManager placeManager,
                             final TranslationService ts); }
DiffItemPresenter { @PreDestroy public void preDestroy() { if (ready && open) { closeContent(); } } @Inject  DiffItemPresenter(final View view,
                             final ResourceTypeManagerCache resourceTypeManagerCache,
                             final PlaceManager placeManager,
                             final TranslationService ts); @PostConstruct void postConstruct(); @PreDestroy void preDestroy(); View getView(); void setup(final ChangeRequestDiff changeRequestDiff,
                      final boolean warnConflict); void draw(); void toggleCollapsibleContainerState(); }
DiffItemPresenter { @PreDestroy public void preDestroy() { if (ready && open) { closeContent(); } } @Inject  DiffItemPresenter(final View view,
                             final ResourceTypeManagerCache resourceTypeManagerCache,
                             final PlaceManager placeManager,
                             final TranslationService ts); @PostConstruct void postConstruct(); @PreDestroy void preDestroy(); View getView(); void setup(final ChangeRequestDiff changeRequestDiff,
                      final boolean warnConflict); void draw(); void toggleCollapsibleContainerState();  }