@Test public void testGetSource() { final InputStream inputStream = mock(InputStream.class); final String expectedSource = "<xml/>"; when(ioService.newInputStream(convertedPath)).thenReturn(inputStream); when(dmnIOHelper.isAsString(inputStream)).thenReturn(expectedSource); final String actualSource = service.getSource(path); assertEquals(expectedSource, actualSource); }
@Override public String getSource(final Path path) { return loadPath(path).map(dmnIOHelper::isAsString).orElse(""); }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override public String getSource(final Path path) { return loadPath(path).map(dmnIOHelper::isAsString).orElse(""); } }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override public String getSource(final Path path) { return loadPath(path).map(dmnIOHelper::isAsString).orElse(""); } @Inject  DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory,
                                 final DMNIOHelper dmnIOHelper,
                                 final DMNPathsHelper pathsHelper,
                                 final PMMLIncludedDocumentFactory pmmlIncludedDocumentFactory); }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override public String getSource(final Path path) { return loadPath(path).map(dmnIOHelper::isAsString).orElse(""); } @Inject  DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory,
                                 final DMNIOHelper dmnIOHelper,
                                 final DMNPathsHelper pathsHelper,
                                 final PMMLIncludedDocumentFactory pmmlIncludedDocumentFactory); @Override String getContent(final Path path); @Override DMNContentResource getProjectContent(final Path path,
                                                final String defSetId); @Override void saveContent(final Path path,
                            final String content,
                            final Metadata metadata,
                            final String comment); @Override List<Path> getModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getDMNModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject); @Override PMMLDocumentMetadata loadPMMLDocumentMetadata(final Path path); @Override String getSource(final Path path); }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override public String getSource(final Path path) { return loadPath(path).map(dmnIOHelper::isAsString).orElse(""); } @Inject  DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory,
                                 final DMNIOHelper dmnIOHelper,
                                 final DMNPathsHelper pathsHelper,
                                 final PMMLIncludedDocumentFactory pmmlIncludedDocumentFactory); @Override String getContent(final Path path); @Override DMNContentResource getProjectContent(final Path path,
                                                final String defSetId); @Override void saveContent(final Path path,
                            final String content,
                            final Metadata metadata,
                            final String comment); @Override List<Path> getModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getDMNModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject); @Override PMMLDocumentMetadata loadPMMLDocumentMetadata(final Path path); @Override String getSource(final Path path);  }