Search in sources :

Example 1 with FixedTestUser

use of com.mercedesbenz.sechub.integrationtest.api.FixedTestUser in project sechub by mercedes-benz.

the class DeveloperAdministration method createAsUserTestObject.

/**
 * Creates temporary test user object and provides direct access to integration
 * test object: AsUser. So all things available in integration tests can be done
 * directly without additional methods
 *
 * @return asUser object
 */
AsUser createAsUserTestObject() {
    String user = provider.getUser();
    String token = provider.getApiToken();
    TestUser testUser = new FixedTestUser(user, token);
    return TestAPI.as(testUser);
}
Also used : FixedTestUser(com.mercedesbenz.sechub.integrationtest.api.FixedTestUser) FixedTestUser(com.mercedesbenz.sechub.integrationtest.api.FixedTestUser) TestUser(com.mercedesbenz.sechub.integrationtest.api.TestUser)

Example 2 with FixedTestUser

use of com.mercedesbenz.sechub.integrationtest.api.FixedTestUser in project sechub by mercedes-benz.

the class DeveloperAdministration method updateTestAPISuperAdmin.

public void updateTestAPISuperAdmin(String userId, String apiToken) {
    IntegrationTestContext integrationTestContext = IntegrationTestContext.get();
    integrationTestContext.setSuperAdminUser(new FixedTestUser(userId, apiToken));
    integrationTestContext.rebuild();
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext) FixedTestUser(com.mercedesbenz.sechub.integrationtest.api.FixedTestUser)

Aggregations

FixedTestUser (com.mercedesbenz.sechub.integrationtest.api.FixedTestUser)2 TestUser (com.mercedesbenz.sechub.integrationtest.api.TestUser)1 IntegrationTestContext (com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext)1