Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Isochrone API support #988

Merged
merged 1 commit into from
Apr 9, 2019
Merged

Conversation

langsmith
Copy link

This pr resolves #905 by adding support for the Mapbox Isochrone API.

As @zugaldia said in #905 (comment), this isochrone support work is basically the same that was done to add support for the Tilequery API.

The Mapbox Android demo app has an Isochrone API example (pr is here), but the API is interacted with in that example in a more raw way than using a formal Mapbox Java SDK wrapper.

@langsmith
Copy link
Author

Would love 👁👁 on this when you get a chance @osana . No rush on my end.

  • I get the following error when I run MapboxIsochroneTest on my local machine. It's the same crash that is in CircleCI.

Screen Shot 2019-04-02 at 3 34 18 PM

Screen Shot 2019-04-02 at 3 26 05 PM

Any idea what I'm doing wrong? I'm not very familiar with AutoValue.

@osana
Copy link
Contributor

osana commented Apr 3, 2019

@langsmith You are missing @AutoValue annotation at the very top of the class

 * @see <a href="https://docs.mapbox.com/api/navigation/#isochrone">API documentation</a>
  * @since 4.5.0
  */
+@AutoValue
 public abstract class MapboxIsochrone extends MapboxService<FeatureCollection, IsochroneService> {

Also isochrone should be added to the TESTABLE_MODULES list in project's build.gradle:

def TESTABLE_MODULES = ["services",
                         "services-core",
                         "services-directions",
                         "services-geocoding",
                         "services-geojson",
+                        "services-isochrone",
                         "services-matching",

@langsmith
Copy link
Author

D'oh. Thanks @osana . Just pushed refactoring to address build.gradle and the @AutoValue annotation.

@langsmith
Copy link
Author

Running tests on my local machine seems to be working, so now it's a matter of fixing the failing ones 💪 . Progress...

Screen Shot 2019-04-03 at 10 43 15 AM

@osana
Copy link
Contributor

osana commented Apr 3, 2019

💪 Make sure @since tags are properly updated as well

@osana
Copy link
Contributor

osana commented Apr 3, 2019

@langsmith tags should be 4.6.0 (I believe) as this is a new feature and we are currently at 4.5.0

@langsmith
Copy link
Author

@langsmith tags should be 4.6.0 (I believe) as this is a new feature and we are currently at 4.5.0

🤦‍♂️ , right, right.

@langsmith
Copy link
Author

fyi, the @since additions in non-isochrone-related classes was because of checkstyle

@langsmith langsmith force-pushed the ls-adding-isochrone-support branch from 810d94a to 4d227be Compare April 3, 2019 20:45
@langsmith langsmith force-pushed the ls-adding-isochrone-support branch from a203e6f to fdfec78 Compare April 4, 2019 18:45

public class IsochroneTestUtils extends TestUtils {
protected static final String ISOCHRONE_WITH_POLYGONS_VALID = "isochroneWithPolygons.json";
protected static final String ISOCHRONE_NO_POLYGONS_VALID = "isochroneNoPolygons.json";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one does not seem to be used.
It looks like all the tests will be using : ISOCHRONE_WITH_POLYGONS_VALID

@langsmith langsmith force-pushed the ls-adding-isochrone-support branch from fdfec78 to e909a5d Compare April 4, 2019 21:21
Copy link
Contributor

@osana osana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thought that we usually allow a List of objects to be given to a Builder, that in turn creates a String out of a list that is request friendly.

@langsmith
Copy link
Author

Another thought that we usually allow a List of objects to be given to a Builder, that in turn creates a String out of a list that is request friendly.

👍 Ok @osana , I just pushed a commit which enables passing through List<Integer>.

@langsmith langsmith force-pushed the ls-adding-isochrone-support branch from 0f646f5 to 13b9448 Compare April 4, 2019 22:50
@langsmith langsmith force-pushed the ls-adding-isochrone-support branch 4 times, most recently from a3b39d1 to 13e81ac Compare April 8, 2019 21:11
@langsmith
Copy link
Author

Ok @osana . I've adjusted the contour minutes and colors methods to take String ... instead of List<String>. Ready for another round of review when you get a chance 🙇

Copy link
Contributor

@osana osana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking pretty good.

There is one thing would be nice to fix.
You could say that there are two types of tests:

  • the ones that test exceptions and request generation
  • the ones that use mock fixtures

The mock fixtures ones need to have requests match the request in the fixture. Otherwise, when we do get a failing test, it is misleading to look at the request parameters.

@langsmith langsmith force-pushed the ls-adding-isochrone-support branch 2 times, most recently from 73ede3b to 61cb5b1 Compare April 9, 2019 00:42
@langsmith langsmith force-pushed the ls-adding-isochrone-support branch from 61cb5b1 to e3428fa Compare April 9, 2019 01:22
@langsmith langsmith merged commit 3e506e1 into master Apr 9, 2019
@langsmith langsmith deleted the ls-adding-isochrone-support branch April 9, 2019 01:35
@osana osana mentioned this pull request Apr 11, 2019
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for the isochrone API
2 participants