To fix #2193 prefix_length member variable has been added to ParsedURL that is set to the length of "/service/version/profile/" prefix when the prefix is accepted by the parser. Also BOOST_FUSION_ADAPT_STRUCT for osrm::server::api::ParsedURL has been moved from header to url_parser.cpp to speed up compilation of CUs that do not use the fusion adaption.
		
			
				
	
	
		
			68 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Gherkin
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Gherkin
		
	
	
	
	
	
| @routing @status @testbot
 | |
| Feature: Status messages
 | |
| 
 | |
|     Background:
 | |
|         Given the profile "testbot"
 | |
| 
 | |
|     Scenario: Route found
 | |
|         Given the node map
 | |
|             | a | b |
 | |
| 
 | |
|         Given the ways
 | |
|             | nodes |
 | |
|             | ab    |
 | |
| 
 | |
|         When I route I should get
 | |
|             | from | to | route | status | message                    |
 | |
|             | a    | b  | ab,ab | 200    |                            |
 | |
|             | b    | a  | ab,ab | 200    |                            |
 | |
| 
 | |
|     Scenario: No route found
 | |
|         Given the node map
 | |
|             | a | b |
 | |
|             |   |   |
 | |
|             | c | d |
 | |
| 
 | |
|         Given the ways
 | |
|             | nodes |
 | |
|             | ab    |
 | |
|             | cd    |
 | |
| 
 | |
|         When I route I should get
 | |
|             | from | to | route | status | message                          |
 | |
|             | a    | b  | ab,ab | 200    |                                  |
 | |
|             | c    | d  | cd,cd | 200    |                                  |
 | |
|             | a    | c  |       | 400    | Impossible route between points  |
 | |
|             | b    | d  |       | 400    | Impossible route between points  |
 | |
| 
 | |
|     Scenario: Malformed requests
 | |
|         Given the node locations
 | |
|             | node | lat  | lon  |
 | |
|             | a    | 1.00 | 1.00 |
 | |
|             | b    | 2.00 | 1.00 |
 | |
| 
 | |
|         And the ways
 | |
|             | nodes |
 | |
|             | ab    |
 | |
| 
 | |
|         When I route I should get
 | |
|             | request                     | status | message                                           |
 | |
|             | route/v1/driving/1,1;1,2    | 200    |                                                   |
 | |
|             | nonsense                    | 400    | URL string malformed close to position 9: "nse"   |
 | |
|             | nonsense/v1/driving/1,1;1,2 | 400    | Service nonsense not found!                       |
 | |
|             |                             | 400    | URL string malformed close to position 1: "/"     |
 | |
|             | /                           | 400    | URL string malformed close to position 1: "//"    |
 | |
|             | ?                           | 400    | URL string malformed close to position 1: "/?"    |
 | |
|             | route/v1/driving            | 400    | URL string malformed close to position 17: "ing"  |
 | |
|             | route/v1/driving/           | 400    | URL string malformed close to position 18: "ng/"  |
 | |
|             | route/v1/driving/1          | 400    | Query string malformed close to position 19       |
 | |
|             | route/v1/driving/1,1        | 400    | Number of coordinates needs to be at least two.   |
 | |
|             | route/v1/driving/1,1,1      | 400    | Query string malformed close to position 21       |
 | |
|             | route/v1/driving/x          | 400    | Query string malformed close to position 18       |
 | |
|             | route/v1/driving/x,y        | 400    | Query string malformed close to position 18       |
 | |
|             | route/v1/driving/1,1;       | 400    | Query string malformed close to position 21       |
 | |
|             | route/v1/driving/1,1;1      | 400    | Query string malformed close to position 23       |
 | |
|             | route/v1/driving/1,1;1,1,1  | 400    | Query string malformed close to position 25       |
 | |
|             | route/v1/driving/1,1;x      | 400    | Query string malformed close to position 21       |
 | |
|             | route/v1/driving/1,1;x,y    | 400    | Query string malformed close to position 21       |
 |