1

I was expecting this 2 invocations to produce the same result, however I'm getting different results.

expectBody("", is(2)) // empty path
expectBody(is(2))  // no path

My context is too big to copy here, but I got this example from the documenation. I'm using expectBody as shown here. However without a "" path, my test is not passing.

I suppose there's a difference between these, but I can't find it in the documentation.

I'm using v.3.1

ResponseSpecBuilder builder = new ResponseSpecBuilder();
builder.expectStatusCode(200);
builder.expectBody("", is(2));
ResponseSpecification responseSpec = builder.build();

when().
       get("/something").
then().
       spec(responseSpec).
Roberto Morávia
  • 492
  • 1
  • 6
  • 13
  • This is something that I have never tried but I've read about this in the usage documentation of rest assured, Check if the below link helps https://github.com/rest-assured/rest-assured/wiki/Usage#specification-re-use – Wilfred Clement Feb 15 '19 at 09:37
  • That's where I got my example from by it doesn't address the issue of an empty path. – Roberto Morávia Feb 15 '19 at 10:50

0 Answers0