Added Scribe in pom file which is used for oauth in restassured as per the documenation, Even then getting the error
java.lang.ClassNotFoundException:com.github.scribejava.core.model.AbstractRequest
How to resolve this error. Added below dependency of scribe in pom file
<dependency>
<groupId>com.github.scribejava</groupId>
<artifactId>scribejava-apis</artifactId>
<version>5.5.0</version>
<scope>test</scope>
</dependency>
Below mentioned the code written to make the request.
Response response = given().auth().
oauth("c", "r", "3", "r1").
post("https://api.twitter.com/1.1/statuses/home_timeline.json").
then().
assertThat().
statusCode(200).
log().all().extract().response();
Have a look at the javadocs:
AbstractRequestwas deprecated in ScribeJava 4.0.0 and it was removed in the version 4.1.0. So it longer exists in ScribeJava 5.5.0 andOAuthRequestmust be used instead.