use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class GoogleSteps method givenGoogleFeed.
@Given("Google feed $uri")
public void givenGoogleFeed(String feedURI) {
String username = System.getenv("GOOGLE_USER");
String password = System.getenv("GOOGLE_PASSWORD");
storyLoader = new LoadOdtFromGoogle(username, password, feedURI);
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class Steps method listCandidates.
public List<StepCandidate> listCandidates() {
List<StepCandidate> candidates = new ArrayList<>();
for (Method method : allMethods()) {
if (method.isAnnotationPresent(Given.class)) {
Given annotation = method.getAnnotation(Given.class);
String value = annotation.value();
int priority = annotation.priority();
addCandidatesFromVariants(candidates, method, GIVEN, value, priority);
addCandidatesFromAliases(candidates, method, GIVEN, priority);
}
if (method.isAnnotationPresent(When.class)) {
When annotation = method.getAnnotation(When.class);
String value = annotation.value();
int priority = annotation.priority();
addCandidatesFromVariants(candidates, method, WHEN, value, priority);
addCandidatesFromAliases(candidates, method, WHEN, priority);
}
if (method.isAnnotationPresent(Then.class)) {
Then annotation = method.getAnnotation(Then.class);
String value = annotation.value();
int priority = annotation.priority();
addCandidatesFromVariants(candidates, method, THEN, value, priority);
addCandidatesFromAliases(candidates, method, THEN, priority);
}
}
return candidates;
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class OrganizationSteps method updateOrganizationWithDefaultAuthPolicy.
@Given("a default authentication policy for $orgName")
public void updateOrganizationWithDefaultAuthPolicy(String orgName) {
Organization org = organizationDao.findByName(orgName);
org.setAuthenticationPolicy(new AuthenticationPolicy());
organizationDao.persist(org);
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class OrganizationSteps method updateOrganizationWithDefaultAuthPolicy.
@Given("authentication policy for $orgName: $authPolicyTable")
public void updateOrganizationWithDefaultAuthPolicy(String orgName, ExamplesTable table) {
Organization org = organizationDao.findByName(orgName);
Map<String, String> row = table.getRow(0);
org.setAuthenticationPolicy(new AuthenticationPolicyBuilder(row).build());
organizationDao.persist(org);
}
use of org.jbehave.core.annotations.Given in project jbehave-core by jbehave.
the class UserSteps method setUserEnabled.
@Given("user for $orgName $username is enabled")
public void setUserEnabled(String orgName, String username) {
Organization org = organizationDao.findByName(orgName);
User user = userDao.findUserByOrganizationAndUsername(org.getId(), username);
user.setEnabled(true);
userDao.persist(user);
}
Aggregations