@Test @SuppressWarnings("unchecked") public void testTransformNewDiagram() { ServiceCallback<Diagram> callback = mock(ServiceCallback.class); String xml = ""; MetadataImpl metadata = new MetadataImpl(); metadata.setDefinitionSetId(DEF_SET_ID); Diagram result = new DiagramImpl("result", graph, metadata); when(factoryManager.newDiagram(anyString(), eq(DEF_SET_ID), any())) .thenReturn(result); when(graph.nodes()).thenReturn(nodes); tested.transform(xml, callback); verify(callback, never()).onError(any()); ArgumentCaptor<Diagram> diagramArgumentCaptor = ArgumentCaptor.forClass(Diagram.class); verify(callback, times(1)).onSuccess(diagramArgumentCaptor.capture()); Diagram diagram = diagramArgumentCaptor.getValue(); assertNotNull(diagram); assertEquals(result, diagram); assertEquals(SHAPE_SET_ID, diagram.getMetadata().getShapeSetId()); }
@Override public void transform(final String xml, final ServiceCallback<Diagram> callback) { doTransform(DEFAULT_DIAGRAM_ID, xml, callback); }
BPMNClientDiagramService extends AbstractKogitoClientDiagramService { @Override public void transform(final String xml, final ServiceCallback<Diagram> callback) { doTransform(DEFAULT_DIAGRAM_ID, xml, callback); } }
BPMNClientDiagramService extends AbstractKogitoClientDiagramService { @Override public void transform(final String xml, final ServiceCallback<Diagram> callback) { doTransform(DEFAULT_DIAGRAM_ID, xml, callback); } protected  BPMNClientDiagramService(); @Inject  BPMNClientDiagramService(final DefinitionManager definitionManager,
                                    final BPMNClientMarshalling marshalling,
                                    final FactoryManager factoryManager,
                                    final BPMNDiagramFactory diagramFactory,
                                    final ShapeManager shapeManager,
                                    final Promises promises,
                                    final WorkItemDefinitionClientService widService); }
BPMNClientDiagramService extends AbstractKogitoClientDiagramService { @Override public void transform(final String xml, final ServiceCallback<Diagram> callback) { doTransform(DEFAULT_DIAGRAM_ID, xml, callback); } protected  BPMNClientDiagramService(); @Inject  BPMNClientDiagramService(final DefinitionManager definitionManager,
                                    final BPMNClientMarshalling marshalling,
                                    final FactoryManager factoryManager,
                                    final BPMNDiagramFactory diagramFactory,
                                    final ShapeManager shapeManager,
                                    final Promises promises,
                                    final WorkItemDefinitionClientService widService); @Override void transform(final String xml,
                          final ServiceCallback<Diagram> callback); @Override void transform(final String fileName,
                          final String xml,
                          final ServiceCallback<Diagram> callback); @Override Promise<String> transform(final KogitoDiagramResourceImpl resource); String transform(final Diagram diagram); }
BPMNClientDiagramService extends AbstractKogitoClientDiagramService { @Override public void transform(final String xml, final ServiceCallback<Diagram> callback) { doTransform(DEFAULT_DIAGRAM_ID, xml, callback); } protected  BPMNClientDiagramService(); @Inject  BPMNClientDiagramService(final DefinitionManager definitionManager,
                                    final BPMNClientMarshalling marshalling,
                                    final FactoryManager factoryManager,
                                    final BPMNDiagramFactory diagramFactory,
                                    final ShapeManager shapeManager,
                                    final Promises promises,
                                    final WorkItemDefinitionClientService widService); @Override void transform(final String xml,
                          final ServiceCallback<Diagram> callback); @Override void transform(final String fileName,
                          final String xml,
                          final ServiceCallback<Diagram> callback); @Override Promise<String> transform(final KogitoDiagramResourceImpl resource); String transform(final Diagram diagram);  }