Guest User

Untitled

a guest
Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. import com.myob.liveaccounts.test.jbehave.StepBase;
  2. import org.jbehave.core.model.ExamplesTable;
  3. import org.jbehave.core.annotations.Given;
  4. import org.jbehave.core.annotations.Then;
  5. import org.jbehave.core.annotations.When;
  6. import org.jbehave.core.annotations.Alias;
  7.  
  8. public class InvoiceSteps extends StepBase {
  9. @Given("a JBehave story file called '$filename'")
  10. public void givenStoryFile(String filename) {
  11. // do stuff
  12. }
  13.  
  14. @Given("I run the JUnit class '$classname'")
  15. public void givenJUnitClass(String filename) {
  16. // do stuff
  17. }
  18.  
  19. @Given("step definitions scattered across several different files")
  20. @Alias("step definitions")
  21. public void givenStepDefinitions() {
  22. // do stuff
  23. }
  24.  
  25. @When("the team talk about the story")
  26. public void talkAboutStory() {
  27. // blah
  28. }
  29.  
  30. @Then("members should understand parts depending on their focus: $table")
  31. public void accountsShouldBalance(ExamplesTable table) {
  32. List<Map<String, String>> rows = table.getRows();
  33. for (Map<String, String> row : rows) {
  34. Person person = Person.focusedOn(row.get("Area of Focus"));
  35. if (row.get("should understand story").equals("yes") {
  36. assertThat(Person, canUnderstandStoryFile(storyFile));
  37. }
  38. if (row.get("should understand step definitions").equals("yes") {
  39. assertThat(Person, canUnderstandStepDefinitions());
  40. }
  41. }
  42. }
  43. }
Add Comment
Please, Sign In to add comment