Search in sources :

Example 1 with FormFieldChanged

use of org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged in project kie-wb-common by kiegroup.

the class MultipleInstanceNodeFilterProviderTest method mockFormFieldChanged.

protected FormFieldChanged mockFormFieldChanged(String fieldName, String uuid) {
    FormFieldChanged formFieldChanged = mock(FormFieldChanged.class);
    when(formFieldChanged.getName()).thenReturn(fieldName);
    when(formFieldChanged.getUuid()).thenReturn(uuid);
    return formFieldChanged;
}
Also used : FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged)

Example 2 with FormFieldChanged

use of org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged in project kie-wb-common by kiegroup.

the class BPMNDocumentationViewTest method onFormFieldChanged.

@Test
public void onFormFieldChanged() {
    tested.setIsSelected(() -> true);
    tested.onFormFieldChanged(new FormFieldChanged(null, null, "uuid"));
    verify(tested).refresh();
}
Also used : FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged) Test(org.junit.Test)

Example 3 with FormFieldChanged

use of org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged in project kie-wb-common by kiegroup.

the class BPMNDocumentationViewTest method onFormFieldChangedNotExists.

@Test
public void onFormFieldChangedNotExists() {
    tested.onFormFieldChanged(new FormFieldChanged(null, null, "uuid2"));
    verify(tested, never()).refresh();
}
Also used : FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged) Test(org.junit.Test)

Example 4 with FormFieldChanged

use of org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged in project kie-wb-common by kiegroup.

the class BPMNDocumentationViewTest method onFormFieldChangedNotActive.

@Test
public void onFormFieldChangedNotActive() {
    tested.setIsSelected(() -> false);
    tested.onFormFieldChanged(new FormFieldChanged(null, null, "uuid"));
    verify(tested, never()).refresh();
}
Also used : FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged) Test(org.junit.Test)

Example 5 with FormFieldChanged

use of org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged in project kie-wb-common by kiegroup.

the class DMNElementsSynchronizerTest method testOnPropertyChanged.

@Test
public void testOnPropertyChanged() {
    final FormFieldChanged event = mock(FormFieldChanged.class);
    final String id = "id";
    final Node node = mock(Node.class);
    final Optional<Node> nodeOptional = Optional.of(node);
    when(event.getUuid()).thenReturn(id);
    doReturn(nodeOptional).when(synchronizer).getNode(id);
    doNothing().when(synchronizer).synchronizeFromNode(nodeOptional);
    synchronizer.onPropertyChanged(event);
    verify(synchronizer).getNode(id);
    verify(synchronizer).synchronizeFromNode(nodeOptional);
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) FormFieldChanged(org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged) Test(org.junit.Test)

Aggregations

FormFieldChanged (org.kie.workbench.common.stunner.forms.client.event.FormFieldChanged)10 Test (org.junit.Test)7 FormDisplayer (org.kie.workbench.common.stunner.forms.client.widgets.container.displayer.FormDisplayer)2 FieldChangeHandler (org.kie.workbench.common.forms.processing.engine.handling.FieldChangeHandler)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1