Skip to content

Commit

Permalink
Enhanced system test documentation #2596
Browse files Browse the repository at this point in the history
- changed SystemTestConfigurationTest which generates
  the configuration file
  • Loading branch information
de-jcup committed Oct 13, 2023
1 parent 38f7fdb commit 7e8a064
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.slf4j.LoggerFactory;

import com.mercedesbenz.sechub.commons.model.JSONConverter;
import com.mercedesbenz.sechub.commons.model.SecHubCodeScanConfiguration;
import com.mercedesbenz.sechub.commons.model.SecHubSecretScanConfiguration;
import com.mercedesbenz.sechub.commons.model.TrafficLight;

class SystemTestConfigurationTest {
Expand All @@ -25,6 +27,8 @@ class SystemTestConfigurationTest {

private static final String DEFINED_PROFILE = "a-defined-profile-when-not-default-used";

private static final String DEFINED_REFERENCE_ID = "an-upload-reference-id";

@Test
void a_full_blown_setup_can_be_serialized_and_deserialized() throws Exception {

Expand Down Expand Up @@ -254,11 +258,21 @@ private void buildTest(SystemTestConfiguration configuration) {
runSecHubJob1.setProject(DEFINED_PROJECT_NAME);

UploadDefinition upload = new UploadDefinition();
upload.setComment("Here we can define either binaries or sources to upload - we define the folders, framework will create tars/zips automatically");
upload.setComment(
"Here we can define either binaries or sources to upload - we define the folders, framework will create tars/zips automatically. When no upload reference id is defined, "
+ DefaultFallback.FALLBACK_UPLOAD_REF_ID.getValue() + " is used as default");
upload.setSourceFolder(Optional.of("./checkout/sources"));
upload.setReferenceId(Optional.of(DefaultFallback.FALLBACK_UPLOAD_REF_ID.getValue()));
upload.setReferenceId(Optional.of(DEFINED_REFERENCE_ID));
runSecHubJob1.getUploads().add(upload);

SecHubCodeScanConfiguration codeScan = new SecHubCodeScanConfiguration();
codeScan.getNamesOfUsedDataConfigurationObjects().add(DEFINED_REFERENCE_ID);
runSecHubJob1.setCodeScan(Optional.of(codeScan));

SecHubSecretScanConfiguration secretScan = new SecHubSecretScanConfiguration();
secretScan.getNamesOfUsedDataConfigurationObjects().add(DEFINED_REFERENCE_ID);
runSecHubJob1.setSecretScan(Optional.of(secretScan));

test1execute1.setRunSecHubJob(Optional.of(runSecHubJob1));

// asserts
Expand Down

0 comments on commit 7e8a064

Please sign in to comment.