This is a RESTful API testing Framework using Java, Maven, JUnit, REST Assured and Jackson to test JSONPlaceholder REST API.
Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. https://maven.apache.org/
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. https://junit.org/junit4/
JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It's great for tutorials, testing new libraries, sharing code examples. https://jsonplaceholder.typicode.com/
The following HTTP methods are tested:
- GET
- POST
- PUT
- PATCH
- DELETE
Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain. http://rest-assured.io/
Jackson is a high-performance JSON processor for Java. Its developers extol the combination of fast, correct, lightweight, and ergonomic attributes of the library. https://github.com/FasterXML/jackson
Eclipse IDE is used to develop this Framework.
- Open file in Eclipse: ..\RestApiTesting.Framework.Leopard\src\test\java\runner\TestRunner.java
- Right click => Run As
- JUnit Test
- Alt + Shift + X, T
- Window => Show View => Other... (Alt + Shift + Q, Q)
- Java => JUnit
- Right click on runner.TestRunner
- Run
- Open Folder in File Explorer: ..\RestApiTesting.Framework.Leopard (where you have the "pom.xml" file)
- Open Command Prompt/Windows PowerShell
- Run "mvn clean test"
- Download "apache-maven-3.6.1-bin.tar.gz" from "https://maven.apache.org/download.cgi#"
- Set the Environment Variables