-1

I cannot post a tweet using Rest assured, the test case passes every time but the status code is 403. I have passed the consumerKey, consumerSecret, accessToken and secretToken. I have attached a screenshot.pleaseCheckAttached

Som
  • 1
  • 3
  • 1
    The test case passed b/c you didn't assert anything. 403 means you're authenticated but has no rights to access/ do this action. It's really hard to help this kind of problem. Sorry. – lucas-nguyen-17 Jul 03 '22 at 11:26

1 Answers1

0

I think you are missing the queryParameter here. Please refer this github page for the complete code to post a tweet.

It should be something like below

PostATweetPOJO postATweet = given().auth()
                .oauth(consumerAPIKey, consumerAPIsecretKey, accessToken, accessTokenSecret)
                .queryParam("status", postATweetData.getStatus()).when().post(Resources.getPostATweetResource()).then()
                .extract().response().as(PostATweetPOJO.class);
Bhanu
  • 53
  • 1
  • 6