@Test public void testLoadImportedItemDefinitions() { final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class); final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition1 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); final org.kie.workbench.common.dmn.api.definition.model.ItemDefinition itemDefinition2 = mock(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition.class); final List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> expectedItemDefinitions = asList(itemDefinition1, itemDefinition2); final List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> actualItemDefinitions = new ArrayList<>(); final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions = new HashMap<>(); final DMNMarshallerStandalone dmnMarshaller = spy(getDMNMarshaller()); doReturn(expectedItemDefinitions).when(dmnMarshaller).getWbImportedItemDefinitions(importDefinitions); when(definitions.getItemDefinition()).thenReturn(actualItemDefinitions); dmnMarshaller.loadImportedItemDefinitions(definitions, importDefinitions); assertEquals(expectedItemDefinitions, actualItemDefinitions); }
void loadImportedItemDefinitions(final Definitions definitions, final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { void loadImportedItemDefinitions(final Definitions definitions, final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); } }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { void loadImportedItemDefinitions(final Definitions definitions, final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { void loadImportedItemDefinitions(final Definitions definitions, final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { void loadImportedItemDefinitions(final Definitions definitions, final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { definitions.getItemDefinition().addAll(getWbImportedItemDefinitions(importDefinitions)); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); static final String INFO_REQ_ID; static final String KNOWLEDGE_REQ_ID; static final String AUTH_REQ_ID; static final String ASSOCIATION_ID; }