Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.myob.liveaccounts.test.jbehave.StepBase;
- import org.jbehave.core.model.ExamplesTable;
- import org.jbehave.core.annotations.Given;
- import org.jbehave.core.annotations.Then;
- import org.jbehave.core.annotations.When;
- import org.jbehave.core.annotations.Alias;
- public class InvoiceSteps extends StepBase {
- @Given("a JBehave story file called '$filename'")
- public void givenStoryFile(String filename) {
- // do stuff
- }
- @Given("I run the JUnit class '$classname'")
- public void givenJUnitClass(String filename) {
- // do stuff
- }
- @Given("step definitions scattered across several different files")
- @Alias("step definitions")
- public void givenStepDefinitions() {
- // do stuff
- }
- @When("the team talk about the story")
- public void talkAboutStory() {
- // blah
- }
- @Then("members should understand parts depending on their focus: $table")
- public void accountsShouldBalance(ExamplesTable table) {
- List<Map<String, String>> rows = table.getRows();
- for (Map<String, String> row : rows) {
- Person person = Person.focusedOn(row.get("Area of Focus"));
- if (row.get("should understand story").equals("yes") {
- assertThat(Person, canUnderstandStoryFile(storyFile));
- }
- if (row.get("should understand step definitions").equals("yes") {
- assertThat(Person, canUnderstandStepDefinitions());
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment