O'Reilly logo

The Cucumber for Java Book by Seb Rose, Matt Wynne, Aslak Hellesoy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making the Switch

Our goal is to introduce a user interface for requesting the cash withdrawal. We want Cucumber to cover us as we make these changes, so we need to change how our test code interacts with the application. Up until now, all our step definitions were talking directly to the domain model. We’re going to change that so that some of them hit the new user interface instead. This is shown in the adjacent figure.

But, which steps need to change?

Let’s take a look at our scenario again:

support_code/10/src/test/resources/cash_withdrawal.feature
 
Feature:​ Cash Withdrawal​​
 
Scenario:​ Successful withdrawal from an account in credit​​
 
Given ​my account has been credited with $100.00​​
 
When ​I withdraw $20​​
 
Then ​$20 should ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required