0
votes

I am trying to create Test Automation framework for Apipgee Proxy URLs.

I am using Rest Assured Framework for Apigee proxy URLs with generating Bearer token on the fly ,Xapi Keyand use Apigee proxy URL. For now token is generated manually using CURL command . I can test well in postman. // accessToken,apiKey below is defined as string // inputrequest.getInputStream() reads JSON needed for body

response= RestAssured
           .given()
           .headers("Authorization","Bearer "+ accessToken)
           .headers("apiKey", apiKeyVar)
           .contentType("application/json")
           .body(inputrequest.getInputStream()).When()
           .post(apigeeProxyURL).then().statusCode(200).extract().response();

I am getting 401 (Unauthorized error) instead of 200. My query here to summarize--

  1. Does RestAssured Framework Supports Apigee Proxy URL .
  2. if same x-api Key and Bearer token works in postman for same end point, why its throwing an error
  3. I read some blogs with variation on how to pass x-api Key and Bearer Token

Please revert back and share directions on how to approach for REST API Automation for Apigee Proxy URLs

Thanks and Regards, Aditya Mandlekar

1

1 Answers

0
votes

Check if you are passing the apikey at the correct place . By default it should pass in the query param. Check your verifyapikey policy which you must have attached to your proxy.