RadarMenuBuilder implements MenuFactory.CustomMenuBuilder,
                                         RadarMenuView.Presenter { @SuppressWarnings("unused") public void onDecisionTablePinnedEvent(final @Observes DecisionTablePinnedEvent event) { final GuidedDecisionTableModellerView.Presenter modeller = event.getPresenter(); if (modeller == null) { return; } if (!modeller.equals(this.modeller)) { return; } view.enableDrag(!event.isPinned()); } @Inject  RadarMenuBuilder(final RadarMenuView view); @PostConstruct void setup(); @Override void setModeller(final GuidedDecisionTableModellerView.Presenter modeller); @Override void push(final MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); @SuppressWarnings("unused") void onUpdateRadarEvent(final @Observes UpdateRadarEvent event); @SuppressWarnings("unused") void onDecisionTablePinnedEvent(final @Observes DecisionTablePinnedEvent event); @SuppressWarnings("unused") void onDecisionTableSelectedEvent(final @Observes DecisionTableSelectedEvent event); @Override void onClick(); @Override void onDragVisibleBounds(final double canvasX,
                                    final double canvasY);  }
@Test public void testEnableDrag_Pinned() { builder.onDecisionTablePinnedEvent(new DecisionTablePinnedEvent(modeller, true)); verify(view, times(1)).enableDrag(eq(false)); }
@Test public void testEnableDrag_Pinned_DifferentModeller() { builder.onDecisionTablePinnedEvent(new DecisionTablePinnedEvent(mock(GuidedDecisionTableModellerView.Presenter.class), true)); verify(view, never()).enableDrag(any(Boolean.class)); }
@Test public void testEnableDrag_Unpinned() { builder.onDecisionTablePinnedEvent(new DecisionTablePinnedEvent(modeller, false)); verify(view, times(1)).enableDrag(eq(true)); }
@Test public void testEnableDrag_Unpinned_DifferentModeller() { builder.onDecisionTablePinnedEvent(new DecisionTablePinnedEvent(mock(GuidedDecisionTableModellerView.Presenter.class), false)); verify(view, never()).enableDrag(any(Boolean.class)); }