Search in sources :

Example 1 with ScenarioContext

use of org.activityinfo.test.capacity.model.ScenarioContext in project activityinfo by bedatadriven.

the class CapacityTest method addScenario.

private void addScenario(Scenario scenario) {
    ScenarioContext scenarioContext = new ScenarioContext(context);
    DevServerAccounts accounts = scenarioContext.getAccounts();
    accounts.setBatchingEnabled(true);
    for (UserRole user : scenario.getUsers()) {
        UserAccount account = accounts.ensureAccountExists(user.getNickName());
        LOGGER.fine(String.format("Created User: %s: %s", account.getEmail(), user.getNickName()));
    }
    accounts.flush();
    scenarios.add(scenario);
}
Also used : ScenarioContext(org.activityinfo.test.capacity.model.ScenarioContext) UserRole(org.activityinfo.test.capacity.model.UserRole) DevServerAccounts(org.activityinfo.test.sut.DevServerAccounts) UserAccount(org.activityinfo.test.sut.UserAccount)

Aggregations

ScenarioContext (org.activityinfo.test.capacity.model.ScenarioContext)1 UserRole (org.activityinfo.test.capacity.model.UserRole)1 DevServerAccounts (org.activityinfo.test.sut.DevServerAccounts)1 UserAccount (org.activityinfo.test.sut.UserAccount)1