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