use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class VisitorSteps method whenTheCompilationUnitIsVisitedByTheVisitorThatReturnsVariableNames.
@When("the CompilationUnit is visited by the visitor that returns variable names")
public void whenTheCompilationUnitIsVisitedByTheVisitorThatReturnsVariableNames() {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
returnedVariableName = nameReturningVisitor.visit(compilationUnit, null);
}
use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class VisitorSteps method whenTheCompilationUnitIsVisitedByThePositionTestVisitor.
@When("the CompilationUnit is visited by the PositionTestVisitor")
public void whenTheCompilationUnitIsVisitedByThePositionTestVisitor() {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
compilationUnit.accept(positionTestVisitor, null);
}
use of org.jbehave.core.annotations.When in project tutorials by eugenp.
the class GithubUserResponsePayloadSteps method whenILookForEugenpViaTheApi.
@When("I look for $user via the api")
public void whenILookForEugenpViaTheApi(String user) throws IOException {
HttpResponse httpResponse = getGithubUserProfile(api, user);
resource = RetrieveUtil.retrieveResourceFromResponse(httpResponse, GitHubUser.class);
}
use of org.jbehave.core.annotations.When in project jbehave-core by jbehave.
the class RESTSteps method storyIsLoaded.
@When("story $name text contains '$text'")
public void storyIsLoaded(String name, String text) {
ResourceLoader loader = resourceLoader();
Resource resource = index.get(name);
String asText = loader.loadResourceAsText(resource.getURI());
assertThat(asText, containsString(text));
}
use of org.jbehave.core.annotations.When 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;
}
Aggregations