@Test public void wbFromDMN_DMNImportNoDefinition() { when(jsitImportMock.getImportType()).thenReturn(DMN_IMPORT_TYPE); when(jsitDefinitionsMock.getDrgElement()).thenReturn(new ArrayList<>(Arrays.asList(mock(JSITDRGElement.class), mock(JSITDRGElement.class)))); when(jsitDefinitionsMock.getItemDefinition()).thenReturn(new ArrayList<>(Arrays.asList(mock(JSITItemDefinition.class)))); Import resultImport = ImportConverter.wbFromDMN(jsitImportMock, null, null); assertTrue(resultImport instanceof ImportDMN); assertEquals(NAMESPACE, resultImport.getNamespace()); assertEquals(LOCATION_URI, resultImport.getLocationURI().getValue()); assertEquals(DESCRIPTION, resultImport.getDescription().getValue()); assertEquals(NAME, resultImport.getName().getValue()); assertEquals(DMN_IMPORT_TYPE, resultImport.getImportType()); assertEquals(0, ((ImportDMN) resultImport).getDrgElementsCount()); assertEquals(0, ((ImportDMN) resultImport).getItemDefinitionsCount()); }
public static Import wbFromDMN(final JSITImport dmn, final JSITDefinitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); final Map<javax.xml.namespace.QName, String> otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); for (Map.Entry<javax.xml.namespace.QName, String> entry : otherAttributes.entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); return result; }
ImportConverter { public static Import wbFromDMN(final JSITImport dmn, final JSITDefinitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); final Map<javax.xml.namespace.QName, String> otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); for (Map.Entry<javax.xml.namespace.QName, String> entry : otherAttributes.entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); return result; } }
ImportConverter { public static Import wbFromDMN(final JSITImport dmn, final JSITDefinitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); final Map<javax.xml.namespace.QName, String> otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); for (Map.Entry<javax.xml.namespace.QName, String> entry : otherAttributes.entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  }
ImportConverter { public static Import wbFromDMN(final JSITImport dmn, final JSITDefinitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); final Map<javax.xml.namespace.QName, String> otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); for (Map.Entry<javax.xml.namespace.QName, String> entry : otherAttributes.entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  static Import wbFromDMN(final JSITImport dmn,
                                   final JSITDefinitions definitions,
                                   final PMMLDocumentMetadata pmmlDocument); }
ImportConverter { public static Import wbFromDMN(final JSITImport dmn, final JSITDefinitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); final Map<javax.xml.namespace.QName, String> otherAttributes = JSITUnaryTests.getOtherAttributesMap(dmn); for (Map.Entry<javax.xml.namespace.QName, String> entry : otherAttributes.entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey().toString()), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(IdPropertyConverter.wbFromDMN(dmn.getId())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); NameSpaceUtils.extractNamespacesKeyedByPrefix(dmn).forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  static Import wbFromDMN(final JSITImport dmn,
                                   final JSITDefinitions definitions,
                                   final PMMLDocumentMetadata pmmlDocument);  }