Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herikerbeth/async-method
Spring Boot web application designed to asynchronously lookup GitHub user information. It queries GitHub's API to fetch data about users, and the lookup process is handled asynchronously using CompletableFuture, allowing for scalable service architecture.
https://github.com/herikerbeth/async-method
java junit maven mockito-junit spring-boot spring-web test-driven-development unit-testing
Last synced: 16 days ago
JSON representation
Spring Boot web application designed to asynchronously lookup GitHub user information. It queries GitHub's API to fetch data about users, and the lookup process is handled asynchronously using CompletableFuture, allowing for scalable service architecture.
- Host: GitHub
- URL: https://github.com/herikerbeth/async-method
- Owner: herikerbeth
- Created: 2025-01-13T02:03:05.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2025-01-13T03:04:12.000Z (20 days ago)
- Last Synced: 2025-01-13T04:19:24.255Z (20 days ago)
- Topics: java, junit, maven, mockito-junit, spring-boot, spring-web, test-driven-development, unit-testing
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Async Method
This is a Spring Boot web application designed to asynchronously lookup GitHub user information. It queries GitHub's API to fetch data about users, and the lookup process is handled asynchronously using `CompletableFuture`, allowing for scalable service architecture.
## Features
- **Search for Users**: Users can search for other GitHub users' information, such as their name and blog URL.
- **Asynchronous Search**: The user search is performed asynchronously, allowing the server to handle other requests while waiting for the search results.
- **Feedback on Search**: The system provides feedback that the search is in progress and returns the user data once the lookup is complete.---
## Technologies Used
- **Java 17**
- **Spring Boot**
- **CompletableFuture for asynchronous operations**
- **REST Template for GitHub API integration**
- **JUnit 5 for unit testing**
- **Mockito for mocking dependencies**
- **SLF4J for logging**---
## Architecture
Below is the UML Class Diagram that illustrates the structure and relationships of the core classes in this application:
```mermaid
classDiagram
class User {
- String name
- String blog
+ getName() String
+ setName(name)
+ getBlog() String
+ setBlog(blog)
+ toString() String
}class LookupService {
<>
+ CompletableFuture~User~ findUser(user)
}class GithubLookupService {
+ CompletableFuture~User~ findUser(user)
- RestTemplate restTemplate
}User <-- GithubLookupService : uses
LookupService <|-- GithubLookupService : implements```
---## Getting Started
### Prerequisites
Before running this application, ensure you have the following installed:
- **Java 17** or later
- **Maven**## Installing the project
First you must clone the repository.
```bash
# clone repository
$ git clone https://github.com/herikerbeth/async-method.git# enter the project folder
$ cd async-method
```Now, inside IntelliJ, we will install the dependencies with Maven
## Starting
Finally, navigate to the Application class file to run the project.## Test the Service
To test the service's functionality, run the unit tests:
```bash
$ mvn test
```
The tests will ensure that the asynchronous lookup service works correctly and that the integration with the GitHub API is functioning as expected.## Source
Based on the official Spring documentation from [Spring.io](https://spring.io/guides/gs/async-method).