use of org.jbehave.core.annotations.Given in project javaparser by javaparser.
the class PrettyPrintingSteps method givenTheClassInTheFile.
@Given("the {class|compilation unit|expression|block|statement|import|annotation|body|class body|interface body} in the file \"$classFile\"")
public void givenTheClassInTheFile(String classFile) throws URISyntaxException, IOException, ParseException {
URL url = getClass().getResource("../samples/" + classFile);
sourceUnderTest = readerToString(new FileReader(new File(url.toURI()))).trim();
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class OrganizationSteps method createOrganizationWithName.
@Given("an organization named $orgNames")
@Alias("organizations named $orgNames")
public void createOrganizationWithName(List<String> orgNames) {
for (String orgName : orgNames) {
Organization org = new Organization();
org.setName(orgName);
org.setAuthenticationPolicy(new AuthenticationPolicy());
organizationDao.persist(org);
}
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class UserSteps method setUserExpired.
@Given("user for $orgName $username is expired")
public void setUserExpired(String orgName, String username) {
Organization org = organizationDao.findByName(orgName);
User user = userDao.findUserByOrganizationAndUsername(org.getId(), username);
user.setExpired(true);
userDao.persist(user);
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class UserSteps method createUsersFromTable.
@Given("the users for $orgName: $userTable")
public void createUsersFromTable(String orgName, ExamplesTable table) {
Organization org = organizationDao.findByName(orgName);
List<Parameters> parametersList = table.getRowsAsParameters(true);
for (Parameters parameters : parametersList) {
userDao.persist(new UserBuilder(org, parameters, table.getHeaders()).build());
}
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class GridSteps method theGameIsRunning.
@Given("a $width by $height game")
@Aliases(values = { "a new game: $width by $height" })
public void theGameIsRunning(int width, int height) {
game = new Game(width, height);
renderer = new StringRenderer();
game.setObserver(renderer);
}
Aggregations