Skip to main content

How do I test before production?

Short answer: Verify entitlements with curl before you write code. Then assert, in CI, that a constrained truck is refused on known trap geometry — with a car-mode control proving the test exercises the constraint.

Step 1 — entitlement, before sprint planning

One curl per endpoint you plan to use. Ten minutes.
curl -gX GET 'https://router.hereapi.com/v8/routes' \
  --data-urlencode 'transportMode=truck' \
  --data-urlencode 'origin=42.0641,-88.0509' \
  --data-urlencode 'destination=41.5250,-88.0817' \
  --data-urlencode 'vehicle[height]=410' \
  --data-urlencode "apiKey=${HERE_API_KEY}" -G
200 = entitled. 401 = wrong key. 403 = right key, missing entitlement.
A 403 in week one is information. A 403 in week six is a schedule failure and a credibility failure.

Step 2 — trap geometry, in CI

Do not ship truck routing without this test. It is the reason bridge strikes make the news.
Route a 410 cm vehicle through these. Any path returned is a failure.
LocationWhy
11foot8 bridge, Durham NCClearance well below 4.1 m
Storrow Drive, Boston MACommercial vehicles prohibited; low overpasses
Southern State Parkway, Long Island NYCommercial vehicles prohibited
@pytest.mark.parametrize("name,origin,dest", TRAPS)
def test_truck_refused(name, origin, dest):
    with pytest.raises(NoRouteError):
        truck_route(origin, dest, TALL_TRUCK)


@pytest.mark.parametrize("name,origin,dest", TRAPS)
def test_car_control_routes(name, origin, dest):
    """A car MUST route. Proves the test exercises the constraint,
    not a bad coordinate or a network failure."""
    car_route(origin, dest)   # must not raise
The car-mode control is not optional. Without it, a test that fails because your coordinates are wrong looks identical to a test that passes because the constraint worked.
Wire this into CI, not a manual QA checklist. A refactor that drops vehicle[height] from a params dict is invisible in code review and obvious in a failing test.

Step 3 — watch the units

vehicle[height] is centimetres. vehicle[grossWeight] is kilograms.Pass 4.1 and you have declared a four-centimetre truck. It routes under every bridge in North America. The response is 200.Units are not validated for plausibility. Validate them yourself.

Step 4 — validate against ground truth, not against a competitor

For routing quality: take 500 real historical trips with telematics actuals. Route them. Compare against what the vehicle actually did, not against another platform. Two wrong answers can agree. Report the residual distribution — median, p90, p99 — not the mean. A platform whose durations are unbiased on average but have twice the variance produces twice as many late deliveries.

What a sandbox key is and isn’t

Sandbox and production keys are separate credentials. Same endpoints, different quotas. Never ship a sandbox key. A free tier is not a pilot. A free tier is a rate-limited product boundary. A pilot is a commercial arrangement scoped to your use case, with the APIs you actually need enabled.

Common misconceptions

“I’ll test truck routing manually before launch.” The constraint that silently disappeared in a refactor is the one that ends up in an incident report. “Two points in a parking lot proved the constraint works.” Synthetic coordinates route under any constraint set. Test on geometry designed to reject you. “200 means the route is valid.” 200 with an empty routes array means no path exists. For truck and hazmat routing, that’s a correct answer. “I’ll validate on the free tier.” Confirm the free tier includes the API you’re validating. It may not.

Truck Routing

Constraints, units, and the trap geometry in detail.

Calculate a Truck Route

Working code, with the CI assertions.

How do I validate the migration?

Ground truth, distributions, and shadow comparison.

Getting a HERE API Key

Entitlements, and why 403 is a commercial conversation.

Need production HERE API keys or implementation support? Placematic is an official HERE Technologies reseller and implementation partner. Talk to us.