Skip to content

Commit

Permalink
DependencyTrack#3470: fixes failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Delcoigne <[email protected]>
  • Loading branch information
sebD committed Apr 12, 2024
1 parent beeeb91 commit 1bf9874
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ public String getComment() {
}

public Boolean isSuppressed() {
return suppressed != null;
return suppressed;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AnalysisDescription {
protected List<AnalysisResponse> analysisResponses;
protected String analysisDetails;
protected String comment;
protected boolean isSuppressed;
protected Boolean isSuppressed;

public AnalysisState getAnalysisState() {
return analysisState;
Expand Down Expand Up @@ -71,7 +71,7 @@ protected void setAnalysisDetails(String analysisDetails) {
this.analysisDetails = analysisDetails;
}

protected void suppressed(boolean isSuppressed) {
protected void suppressed(Boolean isSuppressed) {
this.isSuppressed = isSuppressed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public AnalysisDescriptionBuilder withResponse(AnalysisResponse response) {
return this;
}

public AnalysisDescriptionBuilder withSuppression(boolean isSuppressed) {
public AnalysisDescriptionBuilder withSuppression(Boolean isSuppressed) {
get().suppressed(isSuppressed);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ public AnalysisService() {
* @throws EntityNotFoundException if project, component or vulnerability are not found
*/
public Optional<Analysis> getAnalysis(String projectUuid, String componentUuid, String vulnerabilityUuid) throws EntityNotFoundException {
final Project project = qm.getObjectByUuid(Project.class, projectUuid);
if (project == null) {
throw new EntityNotFoundException("The project could not be found.");
if (StringUtils.trimToNull(projectUuid) != null) {
final Project project = qm.getObjectByUuid(Project.class, projectUuid);
if (project == null) {
throw new EntityNotFoundException("The project could not be found.");
}
}
final Component component = qm.getObjectByUuid(Component.class, componentUuid);
if (component == null) {
Expand Down

0 comments on commit 1bf9874

Please sign in to comment.