Skip to content

Commit

Permalink
Fix multiple test stub invocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 7, 2025
1 parent e275bb9 commit f706c80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package edu.hm.hafner.analysis.registry;

import edu.hm.hafner.analysis.Report.IssueType;

/**
* A descriptor for SpotBugs.
*
Expand Down Expand Up @@ -29,9 +27,4 @@ public String getUrl() {
public String getIconUrl() {
return "https://raw.githubusercontent.com/spotbugs/spotbugs.github.io/master/images/logos/spotbugs_icon_only_zoom_256px.png";
}

@Override
public IssueType getType() {
return IssueType.BUG;
}
}
4 changes: 2 additions & 2 deletions src/test/java/edu/hm/hafner/analysis/ModuleDetectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void shouldIdentifyModuleIfThereAreMoreEntries() {
var ant = PATH_PREFIX_ANT + AntModuleDetector.ANT_PROJECT;
var maven = PATH_PREFIX_MAVEN + MavenModuleDetector.MAVEN_POM;
when(stub.find(any(), anyString())).thenReturn(new String[]{ant, maven});
when(stub.open(PREFIX + ant)).thenReturn(read(AntModuleDetector.ANT_PROJECT));
when(stub.open(PREFIX + ant)).thenAnswer(fileName -> read(AntModuleDetector.ANT_PROJECT));
when(stub.open(PREFIX + maven)).thenAnswer(filename -> read(MavenModuleDetector.MAVEN_POM));
});

Expand Down Expand Up @@ -84,7 +84,7 @@ void shouldEnsureThatOsgiHasPrecedenceOverMavenAndAnt() {
private void verifyOrder(final String prefix, final String ant, final String maven, final String[] foundFiles) {
var factory = createFileSystemStub(stub -> {
when(stub.find(any(), anyString())).thenReturn(foundFiles);
when(stub.open(ant)).thenReturn(read(AntModuleDetector.ANT_PROJECT));
when(stub.open(ant)).thenAnswer(fileName -> read(AntModuleDetector.ANT_PROJECT));
when(stub.open(maven)).thenAnswer(filename -> read(MavenModuleDetector.MAVEN_POM));
});

Expand Down

0 comments on commit f706c80

Please sign in to comment.