use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class IntegrationTestDefaultExecutorConfigurations method defineNessusConfig.
private static TestExecutorConfig defineNessusConfig() {
TestExecutorConfig config = createTestExecutorConfig();
config.enabled = true;
config.executorVersion = 1;
config.productIdentifier = TestExecutorProductIdentifier.NESSUS.name();
config.name = INTTEST_NAME_PREFIX + "Nessus V1";
config.setup.baseURL = "\"https://nessus-intranet.mock.example.org:6000";
config.setup.credentials.user = "nessus-user-id";
config.setup.credentials.password = "nessus-password";
// not initialized - is done at creation time by scenario initializer!
config.uuid = null;
List<TestExecutorSetupJobParam> jobParameters = config.setup.jobParameters;
jobParameters.add(new TestExecutorSetupJobParam("nessus.default.policy.id", "nessus-default-policiy-id"));
return config;
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ScenarioInitializer method ensureDefaultExecutionProfile.
private ScenarioInitializer ensureDefaultExecutionProfile(DefaultTestExecutionProfile profile) {
if (TestAPI.canReloadExecutionProfileData(profile)) {
return this;
}
Set<TestExecutorConfig> realConfigurations = new LinkedHashSet<>();
/*
* we iterate over initial list, where all defaults are inside - but UUID is
* null...
*/
for (TestExecutorConfig config : profile.initialConfigurationsWithoutUUID) {
UUID uuid = TestAPI.as(SUPER_ADMIN).createProductExecutorConfig(config);
// set UUID from service to this so available
config.uuid = uuid;
realConfigurations.add(config);
}
/* define profile */
TestAPI.as(TestAPI.SUPER_ADMIN).createProductExecutionProfile(profile.id, profile);
TestExecutionProfile realProfile = TestAPI.as(TestAPI.SUPER_ADMIN).fetchProductExecutionProfile(profile.id);
/* now we create real configurations having correct uuids etc. */
realProfile.configurations.addAll(realConfigurations);
TestAPI.as(TestAPI.SUPER_ADMIN).updateProductExecutionProfile(profile.id, realProfile);
return this;
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ExecutionProfileScenario1IntTest method sanity_check_for_default_profile1.
@Test
public void sanity_check_for_default_profile1() {
/* execute */
TestExecutionProfile profile = as(SUPER_ADMIN).fetchProductExecutionProfile(ExecutionConstants.DEFAULT_EXECUTION_PROFILE_ID);
/* dump */
String json = JSONConverter.get().toJSON(profile);
LOG.info("default profile 1 as json:{}", json);
/* test */
assertEquals("default profile1 MUST have exactly 3 configurations active!", 3, profile.configurations.size());
for (TestExecutorConfig config : profile.configurations) {
assertTrue("config:" + config.name + " must be enabled but isn't!", config.enabled);
}
assertTrue("default profile1 must be enabled!!! Maybe a test has accidently change the profile? default profiles MAY NOT be altered!", profile.enabled);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class AsUser method addConfigurationToProfile.
public AsUser addConfigurationToProfile(String profileId, UUID... uuids) {
String url = getUrlBuilder().buildAdminFetchesProductExecutionProfile(profileId);
String json = getRestHelper().getJSON(url);
TestExecutionProfile profile = JSONConverter.get().fromJSON(TestExecutionProfile.class, json);
for (UUID uuid : uuids) {
TestExecutorConfig config = new TestExecutorConfig(uuid);
// we do not need to load, because update service does only need uuids, other
// parts are ignored*/
profile.configurations.add(config);
}
return updateProductExecutionProfile(profileId, profile);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class AsUser method fetchProductExecutorConfig.
public TestExecutorConfig fetchProductExecutorConfig(UUID uuid) {
String json = fetchProductExecutorConfigAsJSON(uuid);
TestExecutorConfig result = JSONConverter.get().fromJSON(TestExecutorConfig.class, json);
return result;
}
Aggregations