Feature request: take CharSequence rather than String in get(..), post(...) etc
See original GitHub issueWe are testing our API that uses Katharsis framework with REST Assured. The query parameter naming is a bit verbose, like ?filter[person][name]=tom. So I created a little helper class, that allows me to construct a String representing the API-URL to test like this:
String url = getApiResourceRoute()
.withFilterParam("name", "Tom")
.withFilterParam("age", 30)
.toString();
producing: http://localhost:8080/api/persons?filter[persons][name]=Tom&filter[persons][age]=30
The information that this request is about persons
is stored in a field of the test class, in case you were wondering.
Since the get(...)
methods and it’s siblings only take types that are final, I’ll always need to do something like toString()
as my last method call in the chain. Now, if your get(...)
methods would take a CharSequence
instead of a String
, I could also pass my fancy helper class directly, because it implements CharSequence
. I would love to no not have the toString()
there.
Would make my tests with Rest Assured even more beautiful to behold 😉.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
I guess it shouldn’t. A
String
is aCharSequence
. Most of the ApacheStringUtils
methods take aCharSequence
.Well, I’d say:
Basically anything that helps people getting started. Eclipse wasn’t really fond of opening the project (missing gmaven plugin - dunno), so I used IntelliJ (Community Edition) to open it. I’d guess you use IntelliJ too.
I found this: https://help.github.com/articles/setting-guidelines-for-repository-contributors/ which also links to some more extensive contribution guides.