MicroProfile Starter has generated this MicroProfile application for you.
This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
1) Java Version 11.0 or above
2) IntelliJ IDEA Community version or Ultimate Edition
3) Docker Desktop
4) Docker Compose
5) SQL Database (I have Used PostgreSQL)
6) Postman (For API Testing)
git clone https://github.com/Pandula1234/Pet-Store-API-MiddlewareProject.git
using the following git Command to Clone the Application
git clone https://github.com/Pandula1234/Pet-Store-API-MiddlewareProject.git
If you want to build an [??ber-jar], execute the following command:
./gradlew build -Dquarkus.package.type=uber-jar
To run the application:
java -jar build/petstore-runner.jar
The application can be also packaged using simple:
./gradlew build
It produces the quarkus-run.jar
file in the build/quarkus-app/
directory.
Be aware that it is not an ??ber-jar as the dependencies are copied into the build/quarkus-app/lib/
directory.
To launch the test page, open your browser at the following URL
http://localhost:8080/index.html
You can run your application in dev mode that enables live coding using:
./gradlew quarkusDev
Use a Code editor tool to manipulating the Code segments. You can use any code editing tool.
./gradlew quarkusDev
Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation.
You can create a native executable using:
./gradlew build -Dquarkus.package.type=native
Or, if you don't have Mandrel or GraalVM installed, you can run the native executable build in a container using:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
Or to use Mandrel distribution:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
You can then execute your native executable with:
./build/petstore-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image.
https://github.com/Pandula1234/Pet-Store-API-MiddlewareProject.git
Go to the IntelliJ IDEA and Setup the API from cloned git.
Then Select petstore folder for Build Pet-Store API.
Make sure you have install Java Version 11.0 or Above & configure the Java Home in configuration settings.
JAVA_HOME=C:\Program Files\Java\jdk-11.0.12
A) Setting Up the Gradle in IntelliJ
Go to Settings -> Build -> Select Gradle
B) Building the API after Selecting [Gradle]
After Installing the Plugin from the MarketPlace of IntelliJ , setup up the API.
(I have used PoestgreSQL Sql database to work with PetStore API)
From IntelliJ We can Do the Automated Testing . In my Pet-Store API , following directory file i have Creates Some test Cases.
petstore -> src -> test -> java
In that path, few Automated test cases included to make Sure the API running correctly.
This is the Autoamted Test Suite that I have Prepared for Alpha Testing.
Here is the Link to the Test Suite directory for Test Case.
Using Postman I have done Manual Testing for CRUD operations for
Pet Entity
Pet Type Entity
I have descriptively interpreted in Following Java_Mini_Project Document.
Here are some CRUD operation Test cases with Database Connectivity.
I have Used Postman for Testing the Pet-Store API
For Download Postman Application Click Here
Run http://localhost:8080/pets/id/4
a) Quarkus Runtime
b)Postman Result
a) Quarkus Runtime
b) Postman Result
a) Quarkus Runtime
b) Postman Result
Run http://localhost:8080/pets/name/Dusty
a) Quarkus Runtime
b) Postman Result
Run http://localhost:8080/pets/5
a) Quarkus Runtime
b) Postman Result
Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation.
You can create a native executable using:
./gradlew build -Dquarkus.package.type=native
Or, if you don't have Mandrel or GraalVM installed, you can run the native executable build in a container using:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
Or to use Mandrel distribution:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
You can then execute your native executable with:
./build/petstore-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image.
Deploying the demo app on a docker-compose please visit. ./deploy
docker-compose.yaml file
Contains all the relevent paths for the dockerizing process of "Pet Store API"
- Run
docker-compose up -d
- Open
http://localhost:3000/
and useadmin:admin
credentials - Navigate into
http://localhost:3000/dashboards
- Open
Quarkus Microprofile Metrics
dashboard