0

I'm trying to do something like this, bit is not working fine, I don't get how to import "from" statically from the JsonPath class, that says I should do here:

// "from" is statically imported from the JsonPath class List<String> bookTitles = from(response).getList("store.book.findAll { it.price < 10 }.title");

I'm having this error:

"cannot find symbol symbol: method from(java.lang.String)"

Someone would help me please?, thanks in advance :)

tom redfern
  • 30,562
  • 14
  • 91
  • 126
Zilev av
  • 491
  • 1
  • 7
  • 21

1 Answers1

3

As @IgorRodriguez says:

You must add a static import for the from(String) method in the JsonPath class: import static path.to.class.JsonPath.from;

Worked for me :)

In my case it was:

import static com.jayway.restassured.path.json.JsonPath.from;

Zilev av
  • 491
  • 1
  • 7
  • 21