@SuppressWarnings("unchecked") @Test public void testCustomValidatorWasRegistered() { ArgumentCaptor<MultipleInstanceVariableValidator> validatorCaptor = ArgumentCaptor.forClass(MultipleInstanceVariableValidator.class); FormFieldImpl field = mock(FormFieldImpl.class); List<CustomFieldValidator> validators = mock(List.class); when(field.getCustomValidators()).thenReturn(validators); renderer.registerCustomFieldValidators(field); verify(validators).add(validatorCaptor.capture()); assertNotNull(validatorCaptor.getValue()); }
@Override @SuppressWarnings("unchecked") protected void registerCustomFieldValidators(FormFieldImpl field) { final ClientSession session = sessionManager.getCurrentSession(); final Diagram diagram = session.getCanvasHandler().getDiagram(); final Node node = getSelectedNode(diagram, sessionManager.getCurrentSession()); field.getCustomValidators().add(new MultipleInstanceVariableValidator(node, translationService)); }
MultipleInstanceVariableFieldRenderer extends FieldRenderer<MultipleInstanceVariableFieldDefinition, DefaultFormGroup> { @Override @SuppressWarnings("unchecked") protected void registerCustomFieldValidators(FormFieldImpl field) { final ClientSession session = sessionManager.getCurrentSession(); final Diagram diagram = session.getCanvasHandler().getDiagram(); final Node node = getSelectedNode(diagram, sessionManager.getCurrentSession()); field.getCustomValidators().add(new MultipleInstanceVariableValidator(node, translationService)); } }
MultipleInstanceVariableFieldRenderer extends FieldRenderer<MultipleInstanceVariableFieldDefinition, DefaultFormGroup> { @Override @SuppressWarnings("unchecked") protected void registerCustomFieldValidators(FormFieldImpl field) { final ClientSession session = sessionManager.getCurrentSession(); final Diagram diagram = session.getCanvasHandler().getDiagram(); final Node node = getSelectedNode(diagram, sessionManager.getCurrentSession()); field.getCustomValidators().add(new MultipleInstanceVariableValidator(node, translationService)); } @Inject  MultipleInstanceVariableFieldRenderer(MultipleInstanceVariableEditorWidget widget,
                                                 SessionManager sessionManager,
                                                 ClientTranslationService translationService); }
MultipleInstanceVariableFieldRenderer extends FieldRenderer<MultipleInstanceVariableFieldDefinition, DefaultFormGroup> { @Override @SuppressWarnings("unchecked") protected void registerCustomFieldValidators(FormFieldImpl field) { final ClientSession session = sessionManager.getCurrentSession(); final Diagram diagram = session.getCanvasHandler().getDiagram(); final Node node = getSelectedNode(diagram, sessionManager.getCurrentSession()); field.getCustomValidators().add(new MultipleInstanceVariableValidator(node, translationService)); } @Inject  MultipleInstanceVariableFieldRenderer(MultipleInstanceVariableEditorWidget widget,
                                                 SessionManager sessionManager,
                                                 ClientTranslationService translationService); @Override String getName(); }
MultipleInstanceVariableFieldRenderer extends FieldRenderer<MultipleInstanceVariableFieldDefinition, DefaultFormGroup> { @Override @SuppressWarnings("unchecked") protected void registerCustomFieldValidators(FormFieldImpl field) { final ClientSession session = sessionManager.getCurrentSession(); final Diagram diagram = session.getCanvasHandler().getDiagram(); final Node node = getSelectedNode(diagram, sessionManager.getCurrentSession()); field.getCustomValidators().add(new MultipleInstanceVariableValidator(node, translationService)); } @Inject  MultipleInstanceVariableFieldRenderer(MultipleInstanceVariableEditorWidget widget,
                                                 SessionManager sessionManager,
                                                 ClientTranslationService translationService); @Override String getName();  }