Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omerjuve2023/jpsownstarted
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a public REST API and build out an entire CRUD service complete with tests using JUnit 5.
https://github.com/omerjuve2023/jpsownstarted
dockerfile graalvm http-client java json junit5 learn spring-boot testing
Last synced: 11 days ago
JSON representation
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a public REST API and build out an entire CRUD service complete with tests using JUnit 5.
- Host: GitHub
- URL: https://github.com/omerjuve2023/jpsownstarted
- Owner: OmerJuve2023
- License: agpl-3.0
- Created: 2024-05-19T22:24:48.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-02T18:38:32.000Z (7 months ago)
- Last Synced: 2024-10-31T15:05:20.272Z (about 2 months ago)
- Topics: dockerfile, graalvm, http-client, java, json, junit5, learn, spring-boot, testing
- Language: Java
- Homepage:
- Size: 90.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Json Placeholder API
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a
public REST API and build out an entire CRUD service complete with tests using JUnit 5.## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing
purposes.### Prerequisites
- Java 17 or higher
- Maven
- Docker (optional)### Installing
A step by step series of examples that tell you how to get a development environment running.
1. Clone the repository
```bash
git clone https://github.com/OmerJuve2023/JpsOwnStarted.git
```2. Change into the project directory
```bash
cd JpsOwnStarted
```3. Build the project
```bash
mvn clean install
```4. Run the project
```bash
mvn spring-boot:run
```5. Open your browser and navigate to `http://localhost:8080/api/posts`
## Running the tests
To run the tests, execute the following command:
```bash
mvn test
```## Running the application with Docker
1. Build the Docker image
```bash
docker build -t jps-own-started .
```2. Run the Docker container
```bash
docker run -p 8080:8080 jps-own-started
```## Running the application with GraalVM
1. Build the native image
```bash
mvn -Pnative spring-boot:build-image
```2. Run the native image
```bash
docker run -p 8080:8080 jps-own-started
```## Authors
- **Omer Juve** - [OmerJuve2023](https://github.com/OmerJuve2023)