This project is a simple automation framework for testing Pet Store API endpoints using Java and REST Assured.
- Automated API tests for the Pet Store application
- Built with REST Assured for easy HTTP request/response handling
- Suitable for functional and regression API testing
- Language: Java
- Testing Library: REST Assured
- Build Tool: (Recommended) Maven or Gradle
- Java 8 or later
- Maven or Gradle
-
Clone the repository:
git clone https://github.com/pymalikpy/PetStoreAutomationAPI.git cd PetStoreAutomationAPI -
Install dependencies with Maven:
mvn clean install
or with Gradle:
gradle build
- Use Maven:
mvn test - Or Gradle:
gradle test
src/
└── test/
└── java/
└── (test classes)
- Test classes are typically located in
src/test/java.
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
public class PetStoreTest {
@Test
public void getPetById_returns200() {
Response response = RestAssured.get("https://petstore.swagger.io/v2/pet/1");
assertThat(response.getStatusCode(), equalTo(200));
}
}- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes
- Push to the branch
- Open a pull request
Happy testing with REST Assured!