@@ -3770,14 +3770,14 @@ public void testUserRoadSpeed() {
3770
3770
public void testUserSurfaceSpeed () {
3771
3771
JSONObject body = new JSONObject ();
3772
3772
JSONArray coords = new JSONArray ();
3773
- JSONArray neuenheim = new JSONArray ();
3774
- neuenheim .put (8.685036 );
3775
- neuenheim .put (49.4201314 );
3776
- JSONArray dossenheim = new JSONArray ();
3777
- dossenheim .put (8.668814 );
3778
- dossenheim .put (49.442794 );
3779
- coords .put (neuenheim );
3780
- coords .put (dossenheim );
3773
+ JSONArray south = new JSONArray ();
3774
+ south .put (8.707808 );
3775
+ south .put (49.398337 );
3776
+ JSONArray north = new JSONArray ();
3777
+ north .put (8.710012 );
3778
+ north .put (49.405015 );
3779
+ coords .put (south );
3780
+ coords .put (north );
3781
3781
body .put ("coordinates" , coords );
3782
3782
3783
3783
// since we're testing on the same profile, "shortest" would not be dependent on speed settings
@@ -3788,39 +3788,39 @@ public void testUserSurfaceSpeed() {
3788
3788
given ()
3789
3789
.header ("Accept" , "application/json" )
3790
3790
.header ("Content-Type" , "application/json" )
3791
- .pathParam ("profile" , getParameter ( "carProfile" ) )
3791
+ .pathParam ("profile" , "cycling-mountain" )
3792
3792
.body (body .toString ())
3793
3793
.when ().log ().ifValidationFails ()
3794
3794
.post (getEndPointPath () + "/{profile}" )
3795
3795
.then ().log ().ifValidationFails ()
3796
3796
.assertThat ()
3797
3797
.body ("any { it.key == 'routes' }" , is (true ))
3798
- .body ("routes[0].summary.distance" , is (4507.5f ))
3799
- .body ("routes[0].summary.duration" , is (469.1f ))
3798
+ .body ("routes[0].summary.distance" , is (1532.1f ))
3799
+ .body ("routes[0].summary.duration" , is (349.7f ))
3800
3800
.statusCode (200 );
3801
3801
3802
3802
JSONObject userSpeedLimits = new JSONObject ();
3803
- JSONObject roadSpeedLimits = new JSONObject ();
3804
- roadSpeedLimits .put ("primary" , 30 );
3805
- roadSpeedLimits .put ("secondary" , 30 );
3806
- userSpeedLimits .put ("roadSpeeds" , roadSpeedLimits );
3803
+ JSONObject surfaceSpeedLimits = new JSONObject ();
3804
+ surfaceSpeedLimits .put ("gravel" , 2 );
3805
+ surfaceSpeedLimits .put ("ground" , 2 );
3806
+ surfaceSpeedLimits .put ("compacted" , 2 );
3807
+ userSpeedLimits .put ("surfaceSpeeds" , surfaceSpeedLimits );
3807
3808
body .put ("user_speed_limits" , userSpeedLimits );
3808
3809
3809
3810
// request route limiting speed on primary and secondary roads to 30
3810
3811
given ()
3811
3812
.header ("Accept" , "application/json" )
3812
3813
.header ("Content-Type" , "application/json" )
3813
- .pathParam ("profile" , getParameter ( "carProfile" ) )
3814
+ .pathParam ("profile" , "cycling-mountain" )
3814
3815
.body (body .toString ())
3815
3816
.when ().log ().ifValidationFails ()
3816
3817
.post (getEndPointPath () + "/{profile}" )
3817
3818
.then ().log ().ifValidationFails ()
3818
3819
.assertThat ()
3819
3820
.body ("any { it.key == 'routes' }" , is (true ))
3820
- .body ("routes[0].summary.distance" , is (3811.0f ))
3821
- .body ("routes[0].summary.duration" , is (554.3f ))
3821
+ .body ("routes[0].summary.distance" , is (2485.8f ))
3822
+ .body ("routes[0].summary.duration" , is (497.1f ))
3822
3823
.statusCode (200 );
3823
-
3824
3824
}
3825
3825
3826
3826
@ Test
0 commit comments