Skip to content

Commit

Permalink
Removed unused constructor arg
Browse files Browse the repository at this point in the history
  • Loading branch information
fabapp2 committed Oct 16, 2023
1 parent 7910103 commit 0010a0c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ ParsingEventListener parsingEventListener(ApplicationEventPublisher eventPublish
// }

@Bean
MavenProjectAnalyzer mavenProjectAnalyzer(MavenArtifactDownloader artifactDownloader, ClasspathExtractor classpathExtractor) {
return new MavenProjectAnalyzer(artifactDownloader, classpathExtractor);
MavenProjectAnalyzer mavenProjectAnalyzer(ClasspathExtractor classpathExtractor) {
return new MavenProjectAnalyzer(classpathExtractor);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ public class MavenProjectAnalyzer {

private static final String POM_XML = "pom.xml";
private static final MavenXpp3Reader XPP_3_READER = new MavenXpp3Reader();
private final MavenArtifactDownloader rewriteMavenArtifactDownloader;
private final ClasspathExtractor classpathExtractor;

public MavenProjectAnalyzer(MavenArtifactDownloader rewriteMavenArtifactDownloader, ClasspathExtractor classpathExtractor) {
this.rewriteMavenArtifactDownloader = rewriteMavenArtifactDownloader;
public MavenProjectAnalyzer(ClasspathExtractor classpathExtractor) {
this.classpathExtractor = classpathExtractor;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void parseSimpleMavenProject(@TempDir Path tempDir) {
mock(ConfigurableListableBeanFactory.class),
new ProjectScanner(new DefaultResourceLoader(), parserProperties),
executionContext,
new MavenProjectAnalyzer(mock(RewriteMavenArtifactDownloader.class), classpathExtractor)
new MavenProjectAnalyzer(new ClasspathExtractor(mock(RewriteMavenArtifactDownloader.class)))
);

List<String> parsedFiles = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.mockito.Mockito;
import org.openrewrite.maven.utilities.MavenArtifactDownloader;
import org.springframework.core.io.Resource;
import org.springframework.sbm.parsers.ClasspathExtractor;
import org.springframework.sbm.parsers.MavenProject;
import org.springframework.sbm.parsers.RewriteMavenArtifactDownloader;
import org.springframework.sbm.test.util.DummyResource;
Expand All @@ -50,7 +51,8 @@ class MavenProjectAnalyzerTest {
@BeforeEach
void beforeEach() {
MavenArtifactDownloader rewriteMavenArtifactDownloader = Mockito.mock(RewriteMavenArtifactDownloader.class);
sut = new MavenProjectAnalyzer(rewriteMavenArtifactDownloader, classpathExtractor);
ClasspathExtractor classpathExtractor = new ClasspathExtractor(rewriteMavenArtifactDownloader);
sut = new MavenProjectAnalyzer(classpathExtractor);
}

@Nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void parseMultiModule1_WithCustomParser() {
beanFactory,
new ProjectScanner(new DefaultResourceLoader(), parserProperties),
new RewriteExecutionContext(),
new MavenProjectAnalyzer(mock(RewriteMavenArtifactDownloader.class), classpathExtractor)
new MavenProjectAnalyzer(new ClasspathExtractor(mock(RewriteMavenArtifactDownloader.class)))
);

Set<String> ignoredPatters = Set.of();
Expand Down

0 comments on commit 0010a0c

Please sign in to comment.