use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class AssertExecutionProfile method hasConfigurations.
public AssertExecutionProfile hasConfigurations(UUID... uuids) {
runWithRetries(5, () -> {
for (UUID uuid : uuids) {
TestExecutorConfig found = null;
for (TestExecutorConfig config : config.configurations) {
if (config.uuid.equals(uuid)) {
found = config;
break;
}
}
assertNotNull("project did not contain configuration with uuid :" + uuid, found);
}
assertEquals("Expected configurations found, but there are additional ones", uuids.length, config.configurations.size());
}, () -> {
/* reload the config so we got current state */
config = fetchConfig(config.id);
});
return this;
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class AssertExecutorConfig method assertConfig.
public static AssertExecutorConfig assertConfig(UUID uuid) {
TestExecutorConfig config = fetchConfig(uuid);
assertNotNull(config);
return new AssertExecutorConfig(config);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class EditConfigurationAction method executeDirectly.
/**
* Executes action
*
* @param uuid
* @return true when update was done, otherwise false
*/
public boolean executeDirectly(UUID uuid) {
TestExecutorConfig config = getContext().getAdministration().fetchExecutorConfiguration(uuid);
/* dump to output */
outputAsTextOnSuccess("Config:" + uuid + " ass JSON:\n" + JSONConverter.get().toJSON(config, true));
ExecutorConfigDialogUI ui = new ExecutorConfigDialogUI(getContext(), "Edit existing executor config", config);
ui.setTextForOKButton("Update configuration");
ui.showDialog();
if (!ui.isOkPressed()) {
return false;
}
TestExecutorConfig updatedConfig = ui.getUpdatedConfig();
if (updatedConfig == null) {
return false;
}
getContext().getAdministration().updateExecutorConfiguration(updatedConfig);
outputAsTextOnSuccess("executor config updated:\n" + JSONConverter.get().toJSON(updatedConfig, true));
return true;
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutionProfileScenario7IntTest method an_admin_can_delete_a_profile_containing__a_configuration.
@Test
public void an_admin_can_delete_a_profile_containing__a_configuration() {
/* prepare */
String profileId = "test-profile-to-delete7";
dropExecutionProfileIfExisting(profileId);
TestExecutionProfile profileData = new TestExecutionProfile();
profileData.description = "test1";
profileData.projectIds.add("project1");
UUID uuid = createTestExecutorConfig();
// use created uuid for parameter
TestExecutorConfig config = new TestExecutorConfig(uuid);
profileData.configurations.add(config);
as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData);
/* execute */
as(SUPER_ADMIN).deleteProductExecutionProfile(profileId);
/* test */
assertProfileDoesNotExist(profileId);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutionProfileScenario7IntTest method createTestExecutorConfig.
private UUID createTestExecutorConfig() {
TestExecutorConfig config = new TestExecutorConfig();
config.productIdentifier = TestExecutorProductIdentifier.PDS_CODESCAN.name();
config.name = "pds gosec-1";
config.executorVersion = 1;
config.enabled = false;
config.setup.baseURL = "https://baseurl.product.example.com/start";
UUID uuid = as(SUPER_ADMIN).createProductExecutorConfig(config);
return uuid;
}
Aggregations