Created
April 20, 2011 17:02
-
-
Save maggandalf/931937 to your computer and use it in GitHub Desktop.
Trading Service Steps for testing with JBehave
This file contains hidden or 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
| @Steps | |
| public class TradingServiceSteps { | |
| @Autowired | |
| private TradingService tradingService = null; | |
| private Stock stock; | |
| @Given("a stock of symbol <symbol> and a threshold of <threshold>") | |
| public void aStock(@Named("symbol")String symbol, @Named("threshold")double threshold) { | |
| stock = tradingService.addNewStock(symbol, threshold); | |
| } | |
| @When("the stock is traded at <price>") | |
| public void theStockIsTradedAt(@Named("price")double price) { | |
| stock.setTradeAt(price); | |
| } | |
| @Then("the alert status should be <status>") | |
| public void theAlertStatusShouldBe(@Named("status")StockAlertStatus status) { | |
| assertThat(stock.getStatus(), equalTo(status)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment