Tools for the project:
Development Kit: JAVA JDK Test Framework: TestNG (The other popular test runner framework is JUnit) IDE: IntelliJ Community Edition JDK: Java 17 Build System: Maven Local Server: JSON SERVER
-
open IntelliJ Community Edition and load the project
-
Check Node.js and npm version using commands node -v and npm -v
-
Check for json-server version json-server --version
-
If not detected, install Node.js and npm https://nodejs.org/en/download/, npm install -g json-server@0.16.3
-
It creates a directory for json-server C:\Users[user]\AppData\Roaming\npm
-
Create db.json file with starting data on that path C:\Users[user]\AppData\Roaming\npm\db.json (db.json file can be found in the project folder)
-
Create routes.json file with starting routes on that path C:\Users\user\AppData\Roaming\npm\routes.json (routes.json file can be found in the project folder)
-
Start json-server on path -> C:\Users[user]\AppData\Roaming\npm json-server --port 7000 --routes routes.json --watch db.json open http://localhost:7000/ in your browser
-
Right click on textng.xml file in IntelliJ and run the file or open test package, java package and RestApiTest class and run it.