-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
340 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
...tests/src/test/java/flyinghigh/services/acceptancetests/CalculatePointsFromPurchases.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...ce-tests/src/test/java/flyinghigh/services/acceptancetests/CalculatingRequiredPoints.java
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/EarningPoints.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package flyinghigh.services.acceptancetests; | ||
|
||
import net.thucydides.jbehave.ThucydidesJUnitStories; | ||
import net.thucydides.jbehave.ThucydidesJUnitStory; | ||
|
||
/** | ||
* Created by john on 18/09/2014. | ||
*/ | ||
public class EarningPoints extends ThucydidesJUnitStories { | ||
|
||
public EarningPoints() { | ||
this.findStoriesIn("stories/earning_points"); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
...ance-tests/src/test/java/flyinghigh/services/acceptancetests/ListingAffiliatedHotels.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/ListingAirports.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/ManagingAirports.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package flyinghigh.services.acceptancetests; | ||
|
||
import net.thucydides.jbehave.ThucydidesJUnitStories; | ||
|
||
/** | ||
* Created by john on 18/09/2014. | ||
*/ | ||
public class ManagingAirports extends ThucydidesJUnitStories { | ||
|
||
public ManagingAirports() { | ||
this.findStoriesIn("stories/managing_airports"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/Partners.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package flyinghigh.services.acceptancetests; | ||
|
||
import net.thucydides.jbehave.ThucydidesJUnitStories; | ||
|
||
/** | ||
* Created by john on 18/09/2014. | ||
*/ | ||
public class Partners extends ThucydidesJUnitStories { | ||
|
||
public Partners() { | ||
this.findStoriesIn("stories/partners"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/SpendingPoints.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package flyinghigh.services.acceptancetests; | ||
|
||
import net.thucydides.jbehave.ThucydidesJUnitStories; | ||
|
||
/** | ||
* Created by john on 18/09/2014. | ||
*/ | ||
public class SpendingPoints extends ThucydidesJUnitStories { | ||
|
||
public SpendingPoints() { | ||
this.findStoriesIn("stories/spending_points"); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/domain/FrequentFlyer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package flyinghigh.services.acceptancetests.domain; | ||
|
||
/** | ||
* Created by john on 27/09/2014. | ||
*/ | ||
public enum FrequentFlyer { | ||
Sarah("123456"); | ||
|
||
private final String number; | ||
|
||
FrequentFlyer(String number) { | ||
this.number = number; | ||
} | ||
|
||
public String getNumber() { | ||
return number; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...e-tests/src/test/java/flyinghigh/services/acceptancetests/domain/FrequentFlyerMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package flyinghigh.services.acceptancetests.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Created by john on 27/09/2014. | ||
*/ | ||
@JsonIgnoreProperties({"_links"}) | ||
public class FrequentFlyerMember { | ||
private String id; | ||
private String accountNumber; | ||
private String firstName; | ||
private String lastName; | ||
private String homeAirportCode; | ||
private int statusPoints; | ||
|
||
public FrequentFlyerMember() { | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getAccountNumber() { | ||
return accountNumber; | ||
} | ||
|
||
public void setAccountNumber(String accountNumber) { | ||
this.accountNumber = accountNumber; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public void setLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
|
||
public int getStatusPoints() { | ||
return statusPoints; | ||
} | ||
|
||
public void setStatusPoints(int statusPoints) { | ||
this.statusPoints = statusPoints; | ||
} | ||
|
||
public String getHomeAirportCode() { | ||
return homeAirportCode; | ||
} | ||
|
||
public void setHomeAirportCode(String homeAirportCode) { | ||
this.homeAirportCode = homeAirportCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 27 additions & 1 deletion
28
.../test/java/flyinghigh/services/acceptancetests/stepdefs/FrequentFlyerStepDefinitions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,41 @@ | ||
package flyinghigh.services.acceptancetests.stepdefs; | ||
|
||
import flyinghigh.services.acceptancetests.domain.FrequentFlyer; | ||
import flyinghigh.services.acceptancetests.rest.RestClient; | ||
import flyinghigh.services.acceptancetests.steps.MyAccountUISteps; | ||
import net.thucydides.core.annotations.Steps; | ||
import org.jbehave.core.annotations.Given; | ||
import org.jbehave.core.annotations.Then; | ||
import org.jbehave.core.annotations.When; | ||
|
||
import java.net.URISyntaxException; | ||
|
||
/** | ||
* Created by john on 24/09/2014. | ||
*/ | ||
public class FrequentFlyerStepDefinitions { | ||
|
||
RestClient restClient = new RestClient(); | ||
|
||
@Steps | ||
MyAccountUISteps sarah; | ||
|
||
@Given("I am a frequent flyer") | ||
public void givenAFrequentFlyer() { | ||
// TODO | ||
} | ||
|
||
@Given("$frequentFlyer is a Frequent Flyer member with $points points") | ||
public void giveSarahSomePoints(FrequentFlyer frequentFlyer, int points) throws URISyntaxException { | ||
restClient.updatePointsFor(frequentFlyer.getNumber(), points); | ||
} | ||
|
||
@When("Sarah views her account details") | ||
public void viewAccountDetails() { | ||
sarah.openAccountPage(); | ||
} | ||
|
||
@Then("she should see an account balance of $expectedPoints points") | ||
public void shouldSeePointBalanceOf(int expectedPoints) { | ||
sarah.shouldSeeAccountBalanceOf(expectedPoints); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ce-tests/src/test/resources/stories/earning_points/earning_extra_points_from_status.story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Earning extra points from Frequent Flyer status | ||
|
||
Meta: | ||
@Versions Release 2 | ||
@tag layer:webservice | ||
|
||
Scenario Outline: Earning points on flights by Frequent Flyer status | ||
Given a member has a status of <initialStatus> | ||
When I fly on a flight that is worth <base> base points | ||
Then I should earn a status bonus of <bonus> | ||
And I should have guaranteed minimum earned points per trip of <minimum> | ||
And I should earn <total> points in all | ||
Examples: | ||
| initialStatus | base | bonus | minimum | total | notes | | ||
| Bronze | 439 | 0 | 0 | 439 | | | ||
| Silver | 439 | 220 | 500 | 659 | minimum points | | ||
| Silver | 148 | 111 | 500 | 500 | 50% bonus | | ||
| Gold | 474 | 400 | 1000 | 1000 | minimum points | | ||
| Gold | 2041 | 1531 | 1000 | 3572 | 75% bonus | | ||
|
||
|
||
|
Oops, something went wrong.