I've the following step definition in my Cucumber test:
@When("Customer {string} connects, Negotiates, Sends DR")
public void customerConnectsNegotiatesSendsDR(String session) throws InterruptedException {
buildsAndSendRequestToAgd(session);
RequestMessage requestMessage=new RequestMessage("DataRequest","1");
requestMessageBuilder.build(requestMessage).ifPresent(sender);
I want to update this so I can also have the step @When("Customer {string} connects, Negotiates, Sends DR for snapshot only"). In doing so, RequestMessage("DataRequest","1") would become RequestMessage("DataRequest","0").
I know I could update the @When("Customer {string} connects, Negotiates, Sends DR") step to take a parameter of 0 or 1 but it would require I make the update in all feature files that use it. I'm wondering if there's a simpler way where I can default the value to one but if the step @When("Customer {string} connects, Negotiates, Sends DR for snapshot only") is used it opts for 0.
Is this possible or is there an accepted way to do this?