https://github.com/priyankapoojari/springboot-java-restapi-application
Spring Boot Windows application with backend as Apache h2 Database with REST CRUD operations. Mockito: for Unit Testing. Cucumber with Rest Assured for API Testing. Postman json uploaded to check the api's
https://github.com/priyankapoojari/springboot-java-restapi-application
apache-h2-database cucumber java mockito postman rest-assured restful-api spring-boot
Last synced: 15 days ago
JSON representation
Spring Boot Windows application with backend as Apache h2 Database with REST CRUD operations. Mockito: for Unit Testing. Cucumber with Rest Assured for API Testing. Postman json uploaded to check the api's
- Host: GitHub
- URL: https://github.com/priyankapoojari/springboot-java-restapi-application
- Owner: PriyankaPoojari
- Created: 2021-09-06T15:38:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-09T07:03:49.000Z (11 months ago)
- Last Synced: 2025-05-17T00:15:58.331Z (10 months ago)
- Topics: apache-h2-database, cucumber, java, mockito, postman, rest-assured, restful-api, spring-boot
- Language: Java
- Homepage:
- Size: 36.2 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Table of Contents
## About The Project
This is a simple light-weight Student Info application built using Java language.
All the CRUD operations are supported.
![Student's App Main Screen]
![Student's App Search Screen]
### Built With
* [Spring Boot Framework](https://spring.io/projects/spring-framework)
* [Apache h2 database](https://www.h2database.com/)
* [REST API](https://www.mulesoft.com/resources/api)
* [Mockito for Unit Testing](https://site.mockito.org/)
* [Cucumber BDD for testing](https://cucumber.io/) REST Assured lib
## Getting Started
Download the entire repository and import in Eclipse or Spring tool suite(STS).
When importing the project, select Maven > Maven Existing project option.
### Prerequisites
Following addin must be installed in your Eclipse.
* Maven
* WindowsBuilder (Swing GUI- to view the design) NOT MANDATORY
* Apache Tomcat service running to be stopped. Press Windows+R, type "Services.msc". Stop Apache Tomcat service if is already running. This is because apache h2 console requires service to be started. However if you dont want to check data in h2 database console then you can make changes in config/application.properties for the console to be disabled.
**spring.h2.console.enabled=false**
## Usage
After importing the project, Run as Spring Boot app and select Application.java as main class.
![Run configuration]
Moreover, if importing and running is not possible then Executable-jar is also uploaded to main folder.
Download it and double-click on it. All the api's and the database too will be up and running.
Name: student-app.jar
### To access Database
Open http://localhost:8080/h2-console/login.jsp in browser.
[user: sa, password: password]
JDBC URL: jdbc:h2---Path to sampledata--basedir/data/sampledata.mv.db
The path is also updated in the Eclipse console logs.
![h2 console browser]
![Eclipse Console]
Also note that when application is brought up, the database table schema and sample data provided under (src/main/resources) folder are executed.
### Postman
Postman can be used to test the API's manually.
The workspace is exported and uploaded to base directory of this repository (postman\StudentApp.postman_collection.json)
You can import this in Postman and run the tests once application is started.
### Cucumber BDD for Testing
I have used BDD framework to run the tests to check API's functionality (src/test/java)
Rest-Assured library is used to interact with apis's and check their response code and body.
![Cucumber folder structure]

There are 2 feature files. One with the happy flow and the other one with invalid data to check the API response.