use of com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor in project sechub by mercedes-benz.
the class WithSecHubClient method getFalsePositiveConfigurationOfProject.
public ProjectFalsePositivesDefinition getFalsePositiveConfigurationOfProject(TestProject project, IntegrationTestJSONLocation location) {
File sechubConfigFile = IntegrationTestFileSupport.getTestfileSupport().createFileFromResourcePath(location.getPath());
SecHubClientExecutor executor = createExecutor();
List<String> list = buildEnvironmentAndBehaviourCommands(project);
ExecutionResult result = doExecute(ClientAction.GET_FALSE_POSITIVES, sechubConfigFile, executor, list, null);
if (result.getExitCode() != 0) {
fail("Not exit code 0 but:" + result.getExitCode() + " , last output line was:" + result.getLastOutputLine());
}
File file = result.getJSONFalsePositiveFile();
String json = TestFileSupport.loadTextFile(file, "\n");
return asUser.create(project, json);
}
use of com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor in project sechub by mercedes-benz.
the class WithSecHubClient method createExecutor.
private SecHubClientExecutor createExecutor() {
SecHubClientExecutor executor = new SecHubClientExecutor();
executor.setOutputFolder(outputFolder);
executor.setSechubClientBinaryPath(sechubClientBinaryPath);
executor.setTrustAll(trustAll);
return executor;
}
use of com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor in project sechub by mercedes-benz.
the class WithSecHubClient method startAsynchronScanFor.
public AssertAsyncResult startAsynchronScanFor(TestProject project, IntegrationTestJSONLocation location, Map<String, String> environmentVariables, ApiTokenStrategy apiTokenStrategy) {
File sechubConfigFile = IntegrationTestFileSupport.getTestfileSupport().createFileFromResourcePath(location.getPath());
SecHubClientExecutor executor = createExecutor();
List<String> list = buildEnvironmentAndBehaviourCommands(project);
ExecutionResult result = doExecute(ClientAction.START_ASYNC, apiTokenStrategy, sechubConfigFile, executor, list, environmentVariables);
if (result.getExitCode() != 0) {
fail("Not exit code 0 but:" + result.getExitCode() + " , last output line was:" + result.getLastOutputLine());
}
AssertAsyncResult asynchResult = new AssertAsyncResult();
asynchResult.jobUUID = UUID.fromString(result.getLastOutputLine());
asynchResult.configFile = sechubConfigFile;
return asynchResult;
}
use of com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor in project sechub by mercedes-benz.
the class WithSecHubClient method unmarkAsFalsePositive.
public void unmarkAsFalsePositive(TestProject project, IntegrationTestJSONLocation location, String pathToJSONFile) {
File sechubConfigFile = IntegrationTestFileSupport.getTestfileSupport().createFileFromResourcePath(location.getPath());
SecHubClientExecutor executor = createExecutor();
List<String> list = buildEnvironmentAndBehaviourCommands(project);
list.add("-file");
list.add(pathToJSONFile);
ExecutionResult result = doExecute(ClientAction.UNMARK_FALSE_POSITIVES, sechubConfigFile, executor, list, null);
if (result.getExitCode() != 0) {
fail("Not exit code 0 but:" + result.getExitCode() + " , last output line was:" + result.getLastOutputLine());
}
}
use of com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor in project sechub by mercedes-benz.
the class WithSecHubClient method markAsFalsePositive.
public void markAsFalsePositive(TestProject project, IntegrationTestJSONLocation location, String pathToJSONFile) {
File sechubConfigFile = IntegrationTestFileSupport.getTestfileSupport().createFileFromResourcePath(location.getPath());
SecHubClientExecutor executor = createExecutor();
List<String> list = buildEnvironmentAndBehaviourCommands(project);
list.add("-file");
list.add(pathToJSONFile);
ExecutionResult result = doExecute(ClientAction.MARK_FALSE_POSITIVES, sechubConfigFile, executor, list, null);
if (result.getExitCode() != 0) {
fail("Not exit code 0 but:" + result.getExitCode() + " , last output line was:" + result.getLastOutputLine());
}
}
Aggregations