Logo: Relish

  1. Sign in

Project: Checkout v2.0

  • Change version

    1. v2.0

Consume a valorization resource

As a client application customer
I want to consume a valorization resource
So that I can see the detailed content of the requested valorization

Background
Given
the following valorizations exist
ID offer business-target released-at mileage calculated-for updatable-until zipcode business makes
1 custom-market-value btoc 2010-01-18 5000 2015-08-06 2015-09-06
2 extended-market-value btob 2005-10-21 2888 2015-08-06 null 75010 dealer [36,38,49]
3 extended-market-value both 2001-12-01 9839 2015-08-06 null 75010 dealer [36,38,49]
And
I authenticate as the following proxy user "johndoe"
Scenarios
Get a single resource without metas
Given
I use a valid token which authorizes access to the "Checkout::V2::ValorizationResource" scope
When
I send a GET request for "checkout/2.0/valorizations/1"
Then
the response status should be "200"
And
the response should be a JSON API resource of type "valorizations"
And
the resource should have an attribute "offer" that displays "custom-market-value"
And
the resource should have an attribute "business-target" that displays "btoc"
And
the resource should have an attribute "released-at" that displays "2010-01-18"
And
the resource should have an attribute "mileage" that displays 5000
And
the resource should have an attribute "calculated-for" that displays "2015-08-06"
And
the resource should have an attribute "updatable-until" that displays "2015-09-06"
Get a single resource
Given
I use a valid token which authorizes access to the "Checkout::V2::ValorizationResource" scope
When
I send a GET request for "checkout/2.0/valorizations/ID"
Then
the response status should be "200"
And
the response should be a JSON API resource of type "valorizations"
And
the resource should have an attribute "offer" that displays "offer"
And
the resource should have an attribute "business-target" that displays "business-target"
And
the resource should have an attribute "released-at" that displays "released-at"
And
the resource should have an attribute "mileage" that displays mileage
And
the resource should have an attribute "calculated-for" that displays "calculated-for"
And
the resource should have an attribute "updatable-until" that displays updatable-until
And
the resource should have a meta "zipcode" that displays "zipcode"
And
the resource should have a meta "business" that displays "business"
And
the resource should have a meta "makes" that displays makes
Examples:
ID offer business-target released-at mileage calculated-for updatable-until zipcode business makes
2 extended-market-value btob 2005-10-21 2888 2015-08-06 null 75010 dealer [36,38,49]
3 extended-market-value both 2001-12-01 9839 2015-08-06 null 75010 dealer [36,38,49]
Reject on missing authentication
Given
I send a GET request for "checkout/2.0/valorizations/1"
Then
the response status should be "401"
And
the response should be a JSON API error
Reject on authentication failure
Given
I use an invalid token
When
I send a GET request for "checkout/2.0/valorizations/1"
Then
the response status should be "401"
And
the response should be a JSON API error
Reject on scope failure
Given
I use a valid token which do not authorize access to the "Checkout::V2::ValorizationResource" scope
When
I send a GET request for "checkout/2.0/valorizations/1"
Then
the response status should be "403"
And
the response should be a JSON API error
Resource not found
Given
I use a valid token which authorizes access to the "Checkout::V2::ValorizationResource" scope
When
I send a GET request for "checkout/2.0/valorizations/4"
Then
the response status should be "404"
And
the response should be a JSON API error

Last published over 4 years ago by Donaldo.