Skip to content

Commit

Permalink
Applied spotless mercedes-benz#2724
Browse files Browse the repository at this point in the history
  • Loading branch information
de-jcup committed Dec 4, 2023
1 parent 0e70af7 commit 9c12572
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,29 @@ void when_scan_type_webscan_validation_fails_NOT_with_CONTAINS_NO_SCAN_CONFIGURA
/* test */
assertHasNotError(result, CONTAINS_NO_SCAN_CONFIGURATION);
}

@Test
void when_scan_type_secretscan_validation_fails_NOT_with_CONTAINS_NO_SCAN_CONFIGURATION() {
/* prepare */
SecHubConfigurationModel model = new SecHubConfigurationModel();
model.setSecretScan(new SecHubSecretScanConfiguration());

/* execute */
SecHubConfigurationModelValidationResult result = validatorToTest.validate(model);

/* test */
assertHasNotError(result, CONTAINS_NO_SCAN_CONFIGURATION);
}

@Test
void when_scan_type_infrascan_validation_fails_NOT_with_CONTAINS_NO_SCAN_CONFIGURATION() {
/* prepare */
SecHubConfigurationModel model = new SecHubConfigurationModel();
model.setInfraScan(new SecHubInfrastructureScanConfiguration());

/* execute */
SecHubConfigurationModelValidationResult result = validatorToTest.validate(model);

/* test */
assertHasNotError(result, CONTAINS_NO_SCAN_CONFIGURATION);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ void beforeEach(TestInfo info) {
void faked_xray_can_be_executed_without_errors() throws IOException {
String path = "./src/test/resources/systemtest_xray_licensescan_example.json";
String json = TestFileReader.loadTextFile(path);

SystemTestConfiguration configuration = JSONConverter.get().fromJSON(SystemTestConfiguration.class, json);

/* @formatter:off */

/* execute */
Expand All @@ -80,8 +80,7 @@ void faked_xray_can_be_executed_without_errors() throws IOException {
fail("The execution failed:" + result.toString());
}
}



@Test
void faked_webscan_can_be_executed_without_errors_and_contains_expected_data_in_configuration() throws IOException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,26 @@ 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 xray_license_config_can_be_read_and_contains_license_check() throws Exception {
/* prepare */
String path = "./src/test/resources/systemtest_xray_licensescan_example.json";
String json = TestFileReader.loadTextFile(path);

/* execute */
SystemTestConfiguration result = JSONConverter.get().fromJSON(SystemTestConfiguration.class, json);
/* test*/

/* test */
List<TestDefinition> tests = result.getTests();
assertEquals(1, tests.size());
TestDefinition test = tests.iterator().next();
TestExecutionDefinition exec = test.getExecute();
RunSecHubJobDefinition sechubJob = exec.getRunSecHubJob().get();
assertTrue(sechubJob.getLicenseScan().isPresent());



}

@Test
void a_full_blown_setup_can_be_serialized_and_deserialized() throws Exception {

Expand Down

0 comments on commit 9c12572

Please sign in to comment.