@Test public void testSetStateHandler() { testInitNew(); preview.setStateHandler(handler); verify(handler).getCurrentStateActions(); verify(handler).setStateChangeListener(any()); ArgumentCaptor<Collection> actionsCaptor = ArgumentCaptor.forClass(Collection.class); verify(view).setState(any(), actionsCaptor.capture()); Assertions.assertThat(actionsCaptor.getValue()) .isNotNull() .hasSize(1); }
public void setStateHandler(DocumentPreviewStateActionsHandler handler) { this.actionsHandler = handler; actionsHandler.setStateChangeListener(this::setState); initState(); }
DocumentPreview implements DocumentPreviewView.Presenter,
                                        IsElement { public void setStateHandler(DocumentPreviewStateActionsHandler handler) { this.actionsHandler = handler; actionsHandler.setStateChangeListener(this::setState); initState(); } }
DocumentPreview implements DocumentPreviewView.Presenter,
                                        IsElement { public void setStateHandler(DocumentPreviewStateActionsHandler handler) { this.actionsHandler = handler; actionsHandler.setStateChangeListener(this::setState); initState(); } @Inject  DocumentPreview(DocumentPreviewView view, TranslationService translationService); }
DocumentPreview implements DocumentPreviewView.Presenter,
                                        IsElement { public void setStateHandler(DocumentPreviewStateActionsHandler handler) { this.actionsHandler = handler; actionsHandler.setStateChangeListener(this::setState); initState(); } @Inject  DocumentPreview(DocumentPreviewView view, TranslationService translationService); void init(DocumentData documentData); @Override String getDocumentLink(); @Override String getDocumentName(); void setState(DocumentPreviewState state); DocumentData getDocumentData(); @Override HTMLElement getElement(); void setEnabled(boolean enabled); void setStateHandler(DocumentPreviewStateActionsHandler handler); }
DocumentPreview implements DocumentPreviewView.Presenter,
                                        IsElement { public void setStateHandler(DocumentPreviewStateActionsHandler handler) { this.actionsHandler = handler; actionsHandler.setStateChangeListener(this::setState); initState(); } @Inject  DocumentPreview(DocumentPreviewView view, TranslationService translationService); void init(DocumentData documentData); @Override String getDocumentLink(); @Override String getDocumentName(); void setState(DocumentPreviewState state); DocumentData getDocumentData(); @Override HTMLElement getElement(); void setEnabled(boolean enabled); void setStateHandler(DocumentPreviewStateActionsHandler handler);  }