Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/redhat/exhort/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public int hashCode() {
* @return the deserialized Json report as an AnalysisReport wrapped in a CompletableFuture
* @throws IOException when failed to load the manifest content
*/
CompletableFuture<AnalysisReport> componentAnalysis(String manifest, byte[] manifestContet)
CompletableFuture<AnalysisReport> componentAnalysis(String manifest, byte[] manifestContent)
throws IOException;

CompletableFuture<AnalysisReport> componentAnalysis(String manifest) throws IOException;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/redhat/exhort/sbom/CycloneDXSbom.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CycloneDXSbom implements Sbom {
private Bom bom;
private PackageURL root;

private BiPredicate<Collection, Component> belongingCriteriaBinaryAlgorithm;
private BiPredicate<Collection<?>, Component> belongingCriteriaBinaryAlgorithm;

private <X, Y> Predicate<Y> genericComparator(
BiPredicate<X, Y> binaryBelongingCriteriaAlgorithm, X container) {
Expand All @@ -63,7 +63,7 @@ public CycloneDXSbom() {
this.exhortIgnoreMethod = "insensitive";
}

private static BiPredicate<Collection, Component> getBelongingConditionByName() {
private static BiPredicate<Collection<?>, Component> getBelongingConditionByName() {
return (collection, component) -> collection.contains(component.getName());
}

Expand All @@ -82,7 +82,7 @@ public CycloneDXSbom(BelongingCondition belongingCondition, String exhortIgnoreM
this.exhortIgnoreMethod = exhortIgnoreMethod;
}

private BiPredicate<Collection, Component> getBelongingConditionByPurl() {
private BiPredicate<Collection<?>, Component> getBelongingConditionByPurl() {
return (collection, component) ->
collection.contains(componentToPurl(component).getCoordinates());
}
Expand Down Expand Up @@ -201,7 +201,7 @@ private List<String> createIgnoreFilter(List<Dependency> deps, Collection<String
List<String> result = new ArrayList<>(toIgnore);
for (Dependency dep : deps) {
if (toIgnore.contains(dep.getRef()) && dep.getDependencies() != null) {
List collected =
List<String> collected =
dep.getDependencies().stream().map(p -> p.getRef()).collect(Collectors.toList());
result.addAll(collected);
if (dep.getDependencies().stream().filter(p -> p != null).count() > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
requires jakarta.annotation;
requires java.xml;
requires jakarta.mail;
requires exhort.api;
requires transitive exhort.api;
requires cyclonedx.core.java;
requires packageurl.java;
requires transitive packageurl.java;
requires transitive java.logging;
requires org.tomlj;
requires java.base;
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/com/redhat/exhort/impl/ExhortApiIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.mockito.Mockito.mockStatic;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.redhat.exhort.Api;
import com.redhat.exhort.ExhortTest;
import com.redhat.exhort.api.v4.AnalysisReport;
Expand Down Expand Up @@ -337,13 +336,11 @@ private static void handleJsonResponse(
}

private void handleHtmlResponse(String analysisReportHtml) throws JsonProcessingException {
ObjectMapper om = new ObjectMapper();
assertThat(analysisReportHtml).contains("svg", "html");
}

private void handleHtmlResponseForImage(String analysisReportHtml)
throws JsonProcessingException {
ObjectMapper om = new ObjectMapper();
assertThat(analysisReportHtml).contains("svg", "html");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package com.redhat.exhort.providers;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;

import com.redhat.exhort.tools.Operations;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.*;

Expand Down Expand Up @@ -93,9 +93,7 @@ void determine_Main_Module_Version_GitRepo_commit_is_after_tag() {
gitCommit("sample-2");

goModulesProvider.determineMainModuleVersion(testGitRepo);
assertTrue(
Pattern.matches(
"v1.0.1-0.[0-9]{14}-[a-f0-9]{12}", goModulesProvider.getMainModuleVersion()));
assertThat(goModulesProvider.getMainModuleVersion()).matches("v1.0.1-0.[0-9]{14}-[a-f0-9]{12}");
}

private void gitInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.redhat.exhort.tools.Operations;
import com.redhat.exhort.utils.PythonControllerBase;
import com.redhat.exhort.utils.PythonControllerTestEnv;
import java.util.List;
import org.junit.jupiter.api.extension.*;

public class PythonEnvironmentExtension
Expand All @@ -34,12 +33,6 @@ public class PythonEnvironmentExtension
Operations.getCustomPathOrElse("python3"), Operations.getCustomPathOrElse("pip3"));
private System.Logger log = System.getLogger(this.getClass().getName());

// public PythonEnvironmentExtension(List<String> requirementsFiles) {
// this.requirementsFiles = requirementsFiles;
// }

private List<String> requirementsFiles;

@Override
public void afterAll(ExtensionContext extensionContext) throws Exception {
log.log(System.Logger.Level.INFO, "Finished all python tests and about to clean environment");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean matches(String[] command) {
// in order to let
// custom ArgumentMatcher work correctly.
@Override
public Class type() {
public Class<?> type() {
return String[].class;
}
};
Expand All @@ -50,7 +50,7 @@ public boolean matches(String[] command) {
}

@Override
public Class type() {
public Class<?> type() {
return String[].class;
}
};
Expand Down
Loading