@Test @SuppressWarnings("unchecked") public void testSetTheRightFilter() { ArgumentCaptor<Predicate> predicateArgumentCaptor = ArgumentCaptor.forClass(Predicate.class); preview.init(); verify(delegate).setCommandAllowed(predicateArgumentCaptor.capture()); Predicate<Command<AbstractCanvasHandler, CanvasViolation>> predicate = predicateArgumentCaptor.getValue(); assertTrue(predicate.test(mock(AddNodeCommand.class))); assertFalse(predicate.test(mock(SetKindCommand.class))); }
@PostConstruct public void init() { ((SessionPreviewImpl) delegate).setCommandAllowed(command -> !(command instanceof DMNCommand)); }
DMNSessionPreview implements SessionDiagramPreview<AbstractSession> { @PostConstruct public void init() { ((SessionPreviewImpl) delegate).setCommandAllowed(command -> !(command instanceof DMNCommand)); } }
DMNSessionPreview implements SessionDiagramPreview<AbstractSession> { @PostConstruct public void init() { ((SessionPreviewImpl) delegate).setCommandAllowed(command -> !(command instanceof DMNCommand)); } @Inject  DMNSessionPreview(final @Default SessionDiagramPreview<AbstractSession> delegate); }
DMNSessionPreview implements SessionDiagramPreview<AbstractSession> { @PostConstruct public void init() { ((SessionPreviewImpl) delegate).setCommandAllowed(command -> !(command instanceof DMNCommand)); } @Inject  DMNSessionPreview(final @Default SessionDiagramPreview<AbstractSession> delegate); @PostConstruct void init(); @Override MediatorsControl<C> getMediatorsControl(); @Override void open(final AbstractSession item,
                     final SessionViewerCallback<Diagram> callback); @Override void open(final AbstractSession item,
                     final int width,
                     final int height,
                     final SessionViewerCallback<Diagram> callback); @Override void scale(final int width,
                      final int height); @Override void clear(); @Override void destroy(); @Override AbstractSession getInstance(); @Override AbstractCanvasHandler getHandler(); @Override IsWidget getView(); }
DMNSessionPreview implements SessionDiagramPreview<AbstractSession> { @PostConstruct public void init() { ((SessionPreviewImpl) delegate).setCommandAllowed(command -> !(command instanceof DMNCommand)); } @Inject  DMNSessionPreview(final @Default SessionDiagramPreview<AbstractSession> delegate); @PostConstruct void init(); @Override MediatorsControl<C> getMediatorsControl(); @Override void open(final AbstractSession item,
                     final SessionViewerCallback<Diagram> callback); @Override void open(final AbstractSession item,
                     final int width,
                     final int height,
                     final SessionViewerCallback<Diagram> callback); @Override void scale(final int width,
                      final int height); @Override void clear(); @Override void destroy(); @Override AbstractSession getInstance(); @Override AbstractCanvasHandler getHandler(); @Override IsWidget getView();  }