@Test public void testResultSize() { int size = 3; MvnDependencyTreeAnalyzer analyzer = new MvnDependencyTreeAnalyzer(); analyzer.setAntennaContext(antennaContextMock); when(antennaContextMock.getGeneric(WrappedDependencyNodes.class)) .thenReturn(Optional.of(getNodes(size))); WorkflowStepResult result = analyzer.yield(); assertThat(result.getArtifacts()).hasSize(size); }
@Override public WorkflowStepResult yield() { Optional<WrappedDependencyNodes> wrappedProjectsOptional = context.getGeneric(WrappedDependencyNodes.class); if (!wrappedProjectsOptional.isPresent()) { throw new ExecutionException("No Maven dependency tree was provided for analysis."); } List<DependencyNode> projectList = wrappedProjectsOptional.get().getDependencyNodes(); final List<Artifact> collect = projectList.stream() .map(this::getArtifactFromNode) .collect(Collectors.toList()); return new WorkflowStepResult(collect); }
MvnDependencyTreeAnalyzer extends AbstractAnalyzer { @Override public WorkflowStepResult yield() { Optional<WrappedDependencyNodes> wrappedProjectsOptional = context.getGeneric(WrappedDependencyNodes.class); if (!wrappedProjectsOptional.isPresent()) { throw new ExecutionException("No Maven dependency tree was provided for analysis."); } List<DependencyNode> projectList = wrappedProjectsOptional.get().getDependencyNodes(); final List<Artifact> collect = projectList.stream() .map(this::getArtifactFromNode) .collect(Collectors.toList()); return new WorkflowStepResult(collect); } }
MvnDependencyTreeAnalyzer extends AbstractAnalyzer { @Override public WorkflowStepResult yield() { Optional<WrappedDependencyNodes> wrappedProjectsOptional = context.getGeneric(WrappedDependencyNodes.class); if (!wrappedProjectsOptional.isPresent()) { throw new ExecutionException("No Maven dependency tree was provided for analysis."); } List<DependencyNode> projectList = wrappedProjectsOptional.get().getDependencyNodes(); final List<Artifact> collect = projectList.stream() .map(this::getArtifactFromNode) .collect(Collectors.toList()); return new WorkflowStepResult(collect); } MvnDependencyTreeAnalyzer(); }
MvnDependencyTreeAnalyzer extends AbstractAnalyzer { @Override public WorkflowStepResult yield() { Optional<WrappedDependencyNodes> wrappedProjectsOptional = context.getGeneric(WrappedDependencyNodes.class); if (!wrappedProjectsOptional.isPresent()) { throw new ExecutionException("No Maven dependency tree was provided for analysis."); } List<DependencyNode> projectList = wrappedProjectsOptional.get().getDependencyNodes(); final List<Artifact> collect = projectList.stream() .map(this::getArtifactFromNode) .collect(Collectors.toList()); return new WorkflowStepResult(collect); } MvnDependencyTreeAnalyzer(); @Override WorkflowStepResult yield(); @Override String getName(); }
MvnDependencyTreeAnalyzer extends AbstractAnalyzer { @Override public WorkflowStepResult yield() { Optional<WrappedDependencyNodes> wrappedProjectsOptional = context.getGeneric(WrappedDependencyNodes.class); if (!wrappedProjectsOptional.isPresent()) { throw new ExecutionException("No Maven dependency tree was provided for analysis."); } List<DependencyNode> projectList = wrappedProjectsOptional.get().getDependencyNodes(); final List<Artifact> collect = projectList.stream() .map(this::getArtifactFromNode) .collect(Collectors.toList()); return new WorkflowStepResult(collect); } MvnDependencyTreeAnalyzer(); @Override WorkflowStepResult yield(); @Override String getName();  }