use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class UserAdministrationScenario2IntTest method anynmouse_can_NOT_revoke_user_admin_rights.
@Test
public void anynmouse_can_NOT_revoke_user_admin_rights() {
/* prepare */
TestUser adminUser = USER_2;
as(SUPER_ADMIN).grantSuperAdminRightsTo(adminUser);
assertUser(adminUser).isSuperAdmin();
/* execute + test */
assertUser(ANONYMOUS).canNotRevokeSuperAdminRightsFrom(adminUser, HttpStatus.UNAUTHORIZED);
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class ProjectMockConfigurationScenario2IntTest method a_user_can_change_mock_configuration_and_behavior.
/* ------------------------------------------------ */
/* -----------------Adapter behaviour ------------- */
/* ------------------------------------------------ */
/* @formatter:off */
@Test
public void a_user_can_change_mock_configuration_and_behavior() {
TestUser user = USER_1;
TestProject project = PROJECT_1;
/* Step1: prepare */
as(SUPER_ADMIN).assignUserToProject(user, project).updateWhiteListForProject(project, Arrays.asList(IntegrationTestExampleConstants.INFRASCAN_DEFAULT_WHITELEIST_ENTRY, MockData.NETSPARKER_RED_ZERO_WAIT.getTarget()));
/* test web scan yellow */
as(user).setProjectMockConfiguration(project, createMockScanConfig("webScan", TrafficLight.YELLOW));
assertResult(as(user).createWebScanAndFetchScanData(project)).isYellow();
/* test web scan green */
as(user).setProjectMockConfiguration(project, createMockScanConfig("webScan", TrafficLight.GREEN));
assertResult(as(user).createWebScanAndFetchScanData(project)).isGreen();
/* test code scan red */
as(user).setProjectMockConfiguration(project, createMockScanConfig("codeScan", TrafficLight.RED));
assertResult(as(user).withSecHubClient().startAndWaitForCodeScan(project)).isRed();
/* test infra scan green */
as(user).setProjectMockConfiguration(project, createMockScanConfig("infraScan", TrafficLight.GREEN));
assertResult(as(user).withSecHubClient().createInfraScanAndFetchScanData(project)).isGreen();
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class AbstractSecHubServerTestScenario method cleanupAllTestUsers.
protected void cleanupAllTestUsers() {
List<TestUser> testusers = getTestUsers(getClass());
LOG.debug("CLEANUP all test uses");
for (TestUser user : testusers) {
LOG.debug("Drop user:{}", user);
resetUserInstanceData(user);
dropExistingUser(user);
dropExistingSignups(user);
}
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class AbstractSecHubServerTestScenario method createTestUser.
/**
* Create a test user <b>instance</b> inside a scenario. But will not create the
* real user on database etc. This is only the definition for a scenario. The
* scenario itself will cleanup and handle the test user instance!
*
* @param clazz
* @param userIdPart
* @return
*/
protected static TestUser createTestUser(Class<? extends AbstractSecHubServerTestScenario> clazz, String userIdPart) {
TestUser testUser = new TestUser(userIdPart, null);
List<TestUser> testUsers = getTestUsers(clazz);
testUsers.add(testUser);
return testUser;
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class AbstractSecHubServerTestScenario method prepareTestData.
public void prepareTestData() {
List<TestUser> testUsers = getTestUsers(getClass());
for (TestUser user : testUsers) {
LOG.debug("recalculate user:{}", user);
user.prepare(this);
}
List<TestProject> testProjects = getTestProjects(getClass());
for (TestProject project : testProjects) {
LOG.debug("recalculate project:{}", project);
project.prepare(this);
}
}
Aggregations