Closed jmfield2 closed 7 years ago
I think those changes are done - the test (added to the same method) passes with the patch, and says this without the patch:
Failed tests: testRequestParameters(edu.usf.cutr.pelias.SearchTest): expected:
<...cus.json?text=burger[+]king&api_key=dummyAp...>
but was:
<...cus.json?text=burger[ ]king&api_key=dummyAp...>
Thanks @jmfield2!
Ok, this is now in the v1.0.1
release, which I just published to JCenter and Maven Central. So you should be able to bump version in mobullity and pull down the official release.
This is really published to Maven Central now - see http://search.maven.org/#artifactdetails%7Cedu.usf.cutr%7Cpelias-client-library%7C1.0.1%7Cjar.
This fixes an issue where spaces (and other characters) would break the query.
An alternative (possibly overkill) approach is to use a URIBuilder instead of StringBuilder.
None of the tests failed with this patch, and my local testing yields local results for "burger+k" instead of results outside of the US like it does now.
I did not add any Javadocs RE: the
@throws
for URLEncoder, and there were 2 other warnings about that when I compiled: