@Test public void testGetDocumentByPathWithUnknownPathWithIncludedModel() { final Path path = mock(Path.class); final PMMLIncludedModel includedModel = makePMMLIncludedModel(); when(path.toURI()).thenReturn(URI); when(ioService.newInputStream(any())).thenThrow(new NoSuchFileException()); final PMMLDocumentMetadata document = factory.getDocumentByPath(path, includedModel); assertThat(document).isNotNull(); assertThat(document.getPath()).isEqualTo(URI); assertThat(document.getImportType()).isEqualTo(NAMESPACE); assertThat(document.getName()).isEqualTo(DOCUMENT_NAME); assertThat(document.getModels()).isEmpty(); }
public PMMLDocumentMetadata getDocumentByPath(final Path path) { return Optional.ofNullable(loadPMMLInfo(path)).map(pmml -> convertPMMLInfo(path, pmml)).orElse(emptyPMMLDocumentMetadata(path)); }
PMMLIncludedDocumentFactory { public PMMLDocumentMetadata getDocumentByPath(final Path path) { return Optional.ofNullable(loadPMMLInfo(path)).map(pmml -> convertPMMLInfo(path, pmml)).orElse(emptyPMMLDocumentMetadata(path)); } }
PMMLIncludedDocumentFactory { public PMMLDocumentMetadata getDocumentByPath(final Path path) { return Optional.ofNullable(loadPMMLInfo(path)).map(pmml -> convertPMMLInfo(path, pmml)).orElse(emptyPMMLDocumentMetadata(path)); } PMMLIncludedDocumentFactory(); @Inject  PMMLIncludedDocumentFactory(final @Named("ioStrategy") IOService ioService); }
PMMLIncludedDocumentFactory { public PMMLDocumentMetadata getDocumentByPath(final Path path) { return Optional.ofNullable(loadPMMLInfo(path)).map(pmml -> convertPMMLInfo(path, pmml)).orElse(emptyPMMLDocumentMetadata(path)); } PMMLIncludedDocumentFactory(); @Inject  PMMLIncludedDocumentFactory(final @Named("ioStrategy") IOService ioService); PMMLDocumentMetadata getDocumentByPath(final Path path); PMMLDocumentMetadata getDocumentByPath(final Path path,
                                                  final PMMLIncludedModel includeModel); }
PMMLIncludedDocumentFactory { public PMMLDocumentMetadata getDocumentByPath(final Path path) { return Optional.ofNullable(loadPMMLInfo(path)).map(pmml -> convertPMMLInfo(path, pmml)).orElse(emptyPMMLDocumentMetadata(path)); } PMMLIncludedDocumentFactory(); @Inject  PMMLIncludedDocumentFactory(final @Named("ioStrategy") IOService ioService); PMMLDocumentMetadata getDocumentByPath(final Path path); PMMLDocumentMetadata getDocumentByPath(final Path path,
                                                  final PMMLIncludedModel includeModel);  }