@Test public void fromJSInteropToMetadata_EmptyModels() { final PMMLDocumentData pmmlDocumentDataMock = PowerMockito.mock(PMMLDocumentData.class); PowerMockito.when(pmmlDocumentDataMock.getModels()).thenReturn(Collections.emptyList()); final PMMLDocumentMetadata metadata = PMMLMarshallerConverter.fromJSInteropToMetadata(PATH, pmmlDocumentDataMock); assertEquals(PATH, metadata.getPath()); assertEquals(UNDEFINED, metadata.getName()); assertEquals(0, metadata.getModels().size()); }
public static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath, final PMMLDocumentData pmmlDocumentData) { final List<PMMLModelMetadata> models = new ArrayList<>(); pmmlDocumentData.getModels().stream().forEach(pmmlModelData -> { final String modelName = pmmlModelData.getModelName(); final Set<PMMLParameterMetadata> fields = pmmlModelData.getFields().stream().filter(field -> isValidInputField(field.getUsageType())) .map(field -> new PMMLParameterMetadata(field.getFieldName())).collect(Collectors.toSet()); models.add(new PMMLModelMetadata(modelName, fields)); }); return new PMMLDocumentMetadata(pmmlFilePath, DMNImportTypes.PMML.getDefaultNamespace(), models); }
PMMLMarshallerConverter { public static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath, final PMMLDocumentData pmmlDocumentData) { final List<PMMLModelMetadata> models = new ArrayList<>(); pmmlDocumentData.getModels().stream().forEach(pmmlModelData -> { final String modelName = pmmlModelData.getModelName(); final Set<PMMLParameterMetadata> fields = pmmlModelData.getFields().stream().filter(field -> isValidInputField(field.getUsageType())) .map(field -> new PMMLParameterMetadata(field.getFieldName())).collect(Collectors.toSet()); models.add(new PMMLModelMetadata(modelName, fields)); }); return new PMMLDocumentMetadata(pmmlFilePath, DMNImportTypes.PMML.getDefaultNamespace(), models); } }
PMMLMarshallerConverter { public static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath, final PMMLDocumentData pmmlDocumentData) { final List<PMMLModelMetadata> models = new ArrayList<>(); pmmlDocumentData.getModels().stream().forEach(pmmlModelData -> { final String modelName = pmmlModelData.getModelName(); final Set<PMMLParameterMetadata> fields = pmmlModelData.getFields().stream().filter(field -> isValidInputField(field.getUsageType())) .map(field -> new PMMLParameterMetadata(field.getFieldName())).collect(Collectors.toSet()); models.add(new PMMLModelMetadata(modelName, fields)); }); return new PMMLDocumentMetadata(pmmlFilePath, DMNImportTypes.PMML.getDefaultNamespace(), models); } private  PMMLMarshallerConverter(); }
PMMLMarshallerConverter { public static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath, final PMMLDocumentData pmmlDocumentData) { final List<PMMLModelMetadata> models = new ArrayList<>(); pmmlDocumentData.getModels().stream().forEach(pmmlModelData -> { final String modelName = pmmlModelData.getModelName(); final Set<PMMLParameterMetadata> fields = pmmlModelData.getFields().stream().filter(field -> isValidInputField(field.getUsageType())) .map(field -> new PMMLParameterMetadata(field.getFieldName())).collect(Collectors.toSet()); models.add(new PMMLModelMetadata(modelName, fields)); }); return new PMMLDocumentMetadata(pmmlFilePath, DMNImportTypes.PMML.getDefaultNamespace(), models); } private  PMMLMarshallerConverter(); static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath,
                                                               final PMMLDocumentData pmmlDocumentData); }
PMMLMarshallerConverter { public static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath, final PMMLDocumentData pmmlDocumentData) { final List<PMMLModelMetadata> models = new ArrayList<>(); pmmlDocumentData.getModels().stream().forEach(pmmlModelData -> { final String modelName = pmmlModelData.getModelName(); final Set<PMMLParameterMetadata> fields = pmmlModelData.getFields().stream().filter(field -> isValidInputField(field.getUsageType())) .map(field -> new PMMLParameterMetadata(field.getFieldName())).collect(Collectors.toSet()); models.add(new PMMLModelMetadata(modelName, fields)); }); return new PMMLDocumentMetadata(pmmlFilePath, DMNImportTypes.PMML.getDefaultNamespace(), models); } private  PMMLMarshallerConverter(); static PMMLDocumentMetadata fromJSInteropToMetadata(final String pmmlFilePath,
                                                               final PMMLDocumentData pmmlDocumentData); static final String ACTIVE; }