Thanks for the reply.

So I tried creating two methods as follows:

  @Given("region $name is created as $type")
  public void createRegion(String name, String type) throws Exception {
    ...
  }

  @Given("region $name is created as $type with redundancy $redundancy")
  public void createRegionWithRedundancy(String name, String type, Integer 
redundancy) throws Exception {
    ...
  }

However, both of my story steps are executed by the first method. Thus, for 
the second step type is passed in as "PARTITION with redundancy 1" which is 
wrong.

--Jens

On Thursday, October 6, 2016 at 8:17:21 AM UTC-7, [email protected] wrote:
>
> Hi,
>
> I've just started looking at JBehave and have run into the following 
> problem.
>
> I'd like to have steps that would look something like this:
>
> Given region FOO is created as REPLICATE
> Given region BAR is created as PARTITION with redundancy 1
>
> And a single Given step definition of:
>
> @Given("region $name is created as $type{ with redundancy $redundancy|}")
> public void createRegionWithRedundancy(String name, String type, Integer 
> redundancy) throws Exception {
>     ...
> }
>
> I'm getting a NullPointerException for the first Given. Presumably because 
> there is no 'redundancy' value. Is it possible to make this optional? I 
> would have hoped to at least just get a null value into my test method and 
> handle that myself.
>
> Thanks
> --Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"JBehave Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/jbehave-dev/047ef18e-0032-47a8-afb4-b9a8b03f3f5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to