@Test public void testGetImportedDRGElements() { final Map<Import, Definitions> importDefinitions = new HashMap<>(); final Import anImport = mock(Import.class); final Definitions definitions = mock(Definitions.class); final DRGElement drgElement1 = mock(DRGElement.class); final DRGElement drgElement2 = mock(DRGElement.class); final DRGElement drgElement3 = mock(DRGElement.class); final List<DRGElement> expectedDRGElements = asList(drgElement1, drgElement2, drgElement3); doReturn(expectedDRGElements).when(helper).getDrgElementsWithNamespace(definitions, anImport); importDefinitions.put(anImport, definitions); final List<DRGElement> actualDRGElements = helper.getImportedDRGElements(importDefinitions); assertEquals(expectedDRGElements, actualDRGElements); }
@Override public List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions) { final List<DRGElement> importedNodes = new ArrayList<>(); importDefinitions.forEach((anImport, definitions) -> { importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); }); return importedNodes; }
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions) { final List<DRGElement> importedNodes = new ArrayList<>(); importDefinitions.forEach((anImport, definitions) -> { importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); }); return importedNodes; } }
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions) { final List<DRGElement> importedNodes = new ArrayList<>(); importDefinitions.forEach((anImport, definitions) -> { importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); }); return importedNodes; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject  DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
                                                    final WorkspaceProjectService projectService,
                                                    final DMNMarshaller marshaller,
                                                    final DMNIOHelper dmnIOHelper,
                                                    final PMMLIncludedDocumentFactory pmmlDocumentFactory,
                                                    final @Named("ioStrategy") IOService ioService); }
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions) { final List<DRGElement> importedNodes = new ArrayList<>(); importDefinitions.forEach((anImport, definitions) -> { importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); }); return importedNodes; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject  DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
                                                    final WorkspaceProjectService projectService,
                                                    final DMNMarshaller marshaller,
                                                    final DMNIOHelper dmnIOHelper,
                                                    final PMMLIncludedDocumentFactory pmmlDocumentFactory,
                                                    final @Named("ioStrategy") IOService ioService); @Override Map<Import, Definitions> getImportDefinitions(final Metadata metadata,
                                                         final List<Import> imports); @Override Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata,
                                                              final List<Import> imports); @Override Map<Import, String> getImportXML(final Metadata metadata,
                                            final List<Import> imports); @Override Path getDMNModelPath(final Metadata metadata,
                                final String modelNamespace,
                                final String modelName); @Override List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitions(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject,
                                                                      final String modelName,
                                                                      final String namespace); @Override Optional<InputStream> loadPath(final Path path); }
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions) { final List<DRGElement> importedNodes = new ArrayList<>(); importDefinitions.forEach((anImport, definitions) -> { importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport)); }); return importedNodes; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject  DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
                                                    final WorkspaceProjectService projectService,
                                                    final DMNMarshaller marshaller,
                                                    final DMNIOHelper dmnIOHelper,
                                                    final PMMLIncludedDocumentFactory pmmlDocumentFactory,
                                                    final @Named("ioStrategy") IOService ioService); @Override Map<Import, Definitions> getImportDefinitions(final Metadata metadata,
                                                         final List<Import> imports); @Override Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata,
                                                              final List<Import> imports); @Override Map<Import, String> getImportXML(final Metadata metadata,
                                            final List<Import> imports); @Override Path getDMNModelPath(final Metadata metadata,
                                final String modelNamespace,
                                final String modelName); @Override List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitions(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject,
                                                                      final String modelName,
                                                                      final String namespace); @Override Optional<InputStream> loadPath(final Path path); static final QName NAMESPACE; }