{"action":"created","comment":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments/67984784","id":67984784,"diff_hunk":"@@ -0,0 +1,87 @@\n+/*\n+ * Copyright 2014 Google Inc. All rights reserved.\n+ *\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n+ * file except in compliance with the License. You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed under\n+ * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n+ * ANY KIND, either express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+\n+package com.google.maps;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertNotNull;\n+\n+import com.google.maps.model.CellTower;\n+import com.google.maps.model.GeolocationPostPayload;\n+import com.google.maps.model.GeolocationResult;\n+import com.google.maps.model.WifiAccessPoint;\n+\n+import org.junit.Test;\n+import org.junit.experimental.categories.Category;\n+\n+import java.util.concurrent.TimeUnit;\n+\n+@Category(LargeTests.class)\n+public class GeolocationApiTest extends AuthenticatedTest {\n+\n+  private GeoApiContext context;\n+\n+  public GeolocationApiTest (GeoApiContext context) {\n+    this.context = context\n+        .setQueryRateLimit(3)\n+        .setConnectTimeout(1, TimeUnit.SECONDS)\n+        .setReadTimeout(1, TimeUnit.SECONDS)\n+        .setWriteTimeout(1, TimeUnit.SECONDS);\n+  }\n+\n+  @Test\n+  public void testSimpleGeolocation() throws Exception {\n+    GeolocationPostPayload payload = new GeolocationPostPayload();\n+    payload.homeMobileCountryCode = 310;\n+    payload.homeMobileNetworkCode = 410;\n+    payload.radioType = \"gsm\";\n+    payload.carrier = \"Vodafone\";\n+    payload.considerIp = true;\n+\n+    WifiAccessPoint[] wifiAccessPoints = new WifiAccessPoint[1];\n+    wifiAccessPoints[0] = new WifiAccessPoint();\n+    wifiAccessPoints[0].macAddress =\"01:23:45:67:89:AB\";\n+    wifiAccessPoints[0].signalStrength = -65;\n+    wifiAccessPoints[0].age = 0;\n+    wifiAccessPoints[0].channel = 11;\n+    wifiAccessPoints[0].signalToNoiseRatio = 40;\n+\n+    payload.wifiAccessPoints = wifiAccessPoints;\n+\n+    /*\n+    CellTower[] cellTowers = new CellTower[1];\n+    cellTowers[0] =  new CellTower();\n+    cellTowers[0].cellId = 42;\n+    cellTowers[0].locationAreaCode = 415;\n+    cellTowers[0].mobileCountryCode = 310;\n+    cellTowers[0].mobileNetworkCode = 410;\n+    cellTowers[0].age = 0;\n+    cellTowers[0].signalStrength = -60;\n+    cellTowers[0].timingAdvance = 15;\n+    payload.cellTowers = cellTowers;\n+    */\n+\n+    GeolocationResult result = GeolocationApi.geolocate(context, payload).await();\n+\n+    assertNotNull(result);\n+    assertNotNull(result.location);\n+    assertEquals(\"accuracy\", 2855.0, result.accuracy, 0.01);\n+    assertEquals(\"lat\", 37.428433999999996, result.location.lat, 0.01);\n+    assertEquals(\"lng\", -122.0723816, result.location.lng, 0.01);","path":"src/test/java/com/google/maps/GeolocationApiTest.java","position":82,"original_position":82,"commit_id":"77b9cc319688a9590a51b9dde8eeb0933733759d","original_commit_id":"77b9cc319688a9590a51b9dde8eeb0933733759d","user":{"login":"markmcd","id":109308,"avatar_url":"https://avatars.githubusercontent.com/u/109308?v=3","gravatar_id":"","url":"https://api.github.com/users/markmcd","html_url":"https://github.com/markmcd","followers_url":"https://api.github.com/users/markmcd/followers","following_url":"https://api.github.com/users/markmcd/following{/other_user}","gists_url":"https://api.github.com/users/markmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/markmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markmcd/subscriptions","organizations_url":"https://api.github.com/users/markmcd/orgs","repos_url":"https://api.github.com/users/markmcd/repos","events_url":"https://api.github.com/users/markmcd/events{/privacy}","received_events_url":"https://api.github.com/users/markmcd/received_events","type":"User","site_admin":false},"body":"Generally, you probably want a lower epsilon for lat/lng values, 0.01 change can be quite large for these. That said, I think having such a high (low?) value for accuracy may make 0.01 about right if the results can move around.","created_at":"2016-06-22T02:05:12Z","updated_at":"2016-06-22T02:05:12Z","html_url":"https://github.com/googlemaps/google-maps-services-java/pull/164#discussion_r67984784","pull_request_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments/67984784"},"html":{"href":"https://github.com/googlemaps/google-maps-services-java/pull/164#discussion_r67984784"},"pull_request":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164","id":74314970,"html_url":"https://github.com/googlemaps/google-maps-services-java/pull/164","diff_url":"https://github.com/googlemaps/google-maps-services-java/pull/164.diff","patch_url":"https://github.com/googlemaps/google-maps-services-java/pull/164.patch","issue_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/164","number":164,"state":"open","locked":false,"title":"Adding support for the Geolocation API call.","user":{"login":"kwnevarez","id":19956138,"avatar_url":"https://avatars.githubusercontent.com/u/19956138?v=3","gravatar_id":"","url":"https://api.github.com/users/kwnevarez","html_url":"https://github.com/kwnevarez","followers_url":"https://api.github.com/users/kwnevarez/followers","following_url":"https://api.github.com/users/kwnevarez/following{/other_user}","gists_url":"https://api.github.com/users/kwnevarez/gists{/gist_id}","starred_url":"https://api.github.com/users/kwnevarez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwnevarez/subscriptions","organizations_url":"https://api.github.com/users/kwnevarez/orgs","repos_url":"https://api.github.com/users/kwnevarez/repos","events_url":"https://api.github.com/users/kwnevarez/events{/privacy}","received_events_url":"https://api.github.com/users/kwnevarez/received_events","type":"User","site_admin":false},"body":"This pull request is to initiate a discussion on the proposed changes to support the Geolocation API. Geolocation uses POST calls so support for POST was implemented in both the OkHttp and GAE handlers.\r\n\r\nA simple test case was created, it fails, but I believe that's because I am using assert wrong or creating the result object incorrectly. The call to the server is working and that can be seen by running the tests with the --info flag.\r\n\r\nThe new code can be exercised with:\r\n`$ API_KEY=AIza... ./gradlew test --info --tests com.google.maps.GeolocationApiTest `\r\n\r\nOutput: \r\n```\r\ncom.google.maps.GeolocationApiTest > testSimpleGeolocation[0] STANDARD_ERROR\r\n    Jun 17, 2016 3:22:44 PM com.google.maps.OkHttpRequestHandler handlePost\r\n    INFO: Request: https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB5fznx33Gskw8n0vJx9GCz_3FcASNe09s\r\n    Jun 17, 2016 3:22:44 PM com.google.maps.OkHttpRequestHandler handlePost\r\n    INFO: Request Body: {\"homeMobileCountryCode\":310,\"homeMobileNetworkCode\":410,\"radioType\":\"gsm\",\"carrier\":\"Vodafone\",\"considerIp\":true,\"wifiAccessPoints\":[{\"macAddress\":\"01:23:45:67:89:AB\",\"signalStrength\":-65,\"age\":0,\"channel\":11,\"signalToNoiseRatio\":40}]}\r\n    Jun 17, 2016 3:22:44 PM com.google.maps.internal.OkHttpPendingResult parseResponse\r\n    INFO: response body{\r\n     \"location\": {\r\n      \"lat\": 37.428433999999996,\r\n      \"lng\": -122.0723816\r\n     },\r\n     \"accuracy\": 2855.0\r\n    }\r\n```\r\n\r\n","created_at":"2016-06-17T22:41:36Z","updated_at":"2016-06-22T02:05:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb83535bde2d7b35d128f3c8641a7b3213d7efc3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164/commits","review_comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164/comments","review_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/164/comments","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/77b9cc319688a9590a51b9dde8eeb0933733759d","head":{"label":"kwnevarez:master","ref":"master","sha":"77b9cc319688a9590a51b9dde8eeb0933733759d","user":{"login":"kwnevarez","id":19956138,"avatar_url":"https://avatars.githubusercontent.com/u/19956138?v=3","gravatar_id":"","url":"https://api.github.com/users/kwnevarez","html_url":"https://github.com/kwnevarez","followers_url":"https://api.github.com/users/kwnevarez/followers","following_url":"https://api.github.com/users/kwnevarez/following{/other_user}","gists_url":"https://api.github.com/users/kwnevarez/gists{/gist_id}","starred_url":"https://api.github.com/users/kwnevarez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwnevarez/subscriptions","organizations_url":"https://api.github.com/users/kwnevarez/orgs","repos_url":"https://api.github.com/users/kwnevarez/repos","events_url":"https://api.github.com/users/kwnevarez/events{/privacy}","received_events_url":"https://api.github.com/users/kwnevarez/received_events","type":"User","site_admin":false},"repo":{"id":61243704,"name":"google-maps-services-java","full_name":"kwnevarez/google-maps-services-java","owner":{"login":"kwnevarez","id":19956138,"avatar_url":"https://avatars.githubusercontent.com/u/19956138?v=3","gravatar_id":"","url":"https://api.github.com/users/kwnevarez","html_url":"https://github.com/kwnevarez","followers_url":"https://api.github.com/users/kwnevarez/followers","following_url":"https://api.github.com/users/kwnevarez/following{/other_user}","gists_url":"https://api.github.com/users/kwnevarez/gists{/gist_id}","starred_url":"https://api.github.com/users/kwnevarez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwnevarez/subscriptions","organizations_url":"https://api.github.com/users/kwnevarez/orgs","repos_url":"https://api.github.com/users/kwnevarez/repos","events_url":"https://api.github.com/users/kwnevarez/events{/privacy}","received_events_url":"https://api.github.com/users/kwnevarez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kwnevarez/google-maps-services-java","description":"Java client library for Google Maps API Web Services","fork":true,"url":"https://api.github.com/repos/kwnevarez/google-maps-services-java","forks_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/forks","keys_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/teams","hooks_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/hooks","issue_events_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/issues/events{/number}","events_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/events","assignees_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/assignees{/user}","branches_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/branches{/branch}","tags_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/tags","blobs_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/statuses/{sha}","languages_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/languages","stargazers_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/stargazers","contributors_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/contributors","subscribers_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/subscribers","subscription_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/subscription","commits_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/contents/{+path}","compare_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/merges","archive_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/downloads","issues_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/issues{/number}","pulls_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/pulls{/number}","milestones_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/milestones{/number}","notifications_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/labels{/name}","releases_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/releases{/id}","deployments_url":"https://api.github.com/repos/kwnevarez/google-maps-services-java/deployments","created_at":"2016-06-15T21:53:49Z","updated_at":"2016-06-15T21:53:51Z","pushed_at":"2016-06-17T22:27:31Z","git_url":"git://github.com/kwnevarez/google-maps-services-java.git","ssh_url":"git@github.com:kwnevarez/google-maps-services-java.git","clone_url":"https://github.com/kwnevarez/google-maps-services-java.git","svn_url":"https://github.com/kwnevarez/google-maps-services-java","homepage":"","size":1486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googlemaps:master","ref":"master","sha":"44ecfeaa48bf09c206db12abfda3c6777c7f0594","user":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"repo":{"id":22978651,"name":"google-maps-services-java","full_name":"googlemaps/google-maps-services-java","owner":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlemaps/google-maps-services-java","description":"Java client library for Google Maps API Web Services","fork":false,"url":"https://api.github.com/repos/googlemaps/google-maps-services-java","forks_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/forks","keys_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/teams","hooks_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/hooks","issue_events_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/events{/number}","events_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/events","assignees_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/assignees{/user}","branches_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/branches{/branch}","tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/tags","blobs_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/languages","stargazers_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/stargazers","contributors_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/contributors","subscribers_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/subscribers","subscription_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/subscription","commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/contents/{+path}","compare_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/merges","archive_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/downloads","issues_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues{/number}","pulls_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/labels{/name}","releases_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/releases{/id}","deployments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/deployments","created_at":"2014-08-15T04:35:21Z","updated_at":"2016-06-20T19:08:43Z","pushed_at":"2016-06-21T11:08:52Z","git_url":"git://github.com/googlemaps/google-maps-services-java.git","ssh_url":"git@github.com:googlemaps/google-maps-services-java.git","clone_url":"https://github.com/googlemaps/google-maps-services-java.git","svn_url":"https://github.com/googlemaps/google-maps-services-java","homepage":"","size":1811,"stargazers_count":374,"watchers_count":374,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":294,"mirror_url":null,"open_issues_count":19,"forks":294,"open_issues":19,"watchers":374,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164"},"html":{"href":"https://github.com/googlemaps/google-maps-services-java/pull/164"},"issue":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/164"},"comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/77b9cc319688a9590a51b9dde8eeb0933733759d"}}}}
{"actor":{"display_login":"markmcd"}}