Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Unroll
- "Should return #code when token is #token and account is #account" (token, token_value, account, account_id, code, content, error_code) {
- expect: "should return #code, correct data and content type"
- when:
- def resp = restClient.get([path: apiPath, query: [token: token_value, 'account_id': account_id]])
- then:
- with(resp) {
- status == code
- contentType == Constants.CT_APPLICATION_JSON;
- }
- with(resp.data.content && content != null) {
- content == content
- }
- with(resp.data.error) {
- code == error_code
- message == 'user unauthorized: Invalid auth token = ' + token_value
- }
- where: "Token is #token and account #account"
- token | token_value | account | account_id | code | content | error_code
- "correct" | User.getToken("integrator", "integrator") | "exists" | "3p7g-nqPTI6Vt_CGRPW_zA" | 200 | [] | null
- "incorrect" | "incorrect_token" | "exists" | "3p7g-nqPTI6Vt_CGRPW_zA" | 401 | null | null
- "null" | null | "exists" | "3p7g-nqPTI6Vt_CGRPW_zA" | 401 | null | null
- "expired" | User.getToken("integrator", "integrator", 0) | "exists" | "3p7g-nqPTI6Vt_CGRPW_zA" | 401 | null | 1401
- "correct" | User.getToken("integrator", "integrator") | "null" | null | 200 | [] | null
- "correct" | User.getToken("integrator", "integrator") | "empty" | "" | 200 | [] | null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement