-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Add proper readme with some basic usage information. ## Type of Change * Documentation update ## Checklist - [x] My code follows the style guidelines of this project Signed-off-by: Jakub Stejskal <[email protected]>
- Loading branch information
Showing
1 changed file
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,100 @@ | ||
# load-generator | ||
Generates reasonable load for messaging clients | ||
|
||
# Data Generator | ||
|
||
## Overview | ||
|
||
The Data Generator project provides a flexible and customizable way to generate random data for various use cases, such as testing, development, and simulation. The project leverages the [DataFaker](https://github.com/DiUS/java-faker) library to create realistic and diverse datasets. The current implementation includes generators for payment, aviation, StarGate, and StarWars data. | ||
|
||
## Features | ||
|
||
- Generate realistic data for various domains | ||
- Easily extendable with new data templates | ||
- Uses DataFaker for rich and varied data generation | ||
- Outputs data in JSON format for easy integration | ||
|
||
## Local Build | ||
|
||
1. Clone the repository: | ||
```bash | ||
git clone https://github.com/skodjob/data-generator.git | ||
``` | ||
2. Navigate to the project directory: | ||
```bash | ||
cd data-generator | ||
``` | ||
3. Build the project using Maven: | ||
```bash | ||
mvn clean install | ||
``` | ||
|
||
## Usage | ||
|
||
### Include dependency to your maven test project | ||
```xml | ||
<dependency> | ||
<groupId>io.skodjob</groupId> | ||
<artifactId>data-generator</artifactId> | ||
</dependency> | ||
``` | ||
|
||
### Generate Payment Data | ||
|
||
To generate payment data, use the `payment_data` template: | ||
|
||
```java | ||
import io.skodjob.datagenerator.DataGenerator; | ||
import io.skodjob.datagenerator.enums.ETemplateType; | ||
public class Main { | ||
public static void main(String[] args) { | ||
DataGenerator dataGenerator = new DataGenerator(ETemplateType.PAYMENT_FIAT); | ||
String paymentDataString = dataGenerator.generateStringData(); | ||
JsonNode paymentDataJson = dataGenerator.generateJsonData(); | ||
System.out.println(paymentDataString); | ||
} | ||
} | ||
``` | ||
|
||
### Generate Flight Data | ||
|
||
To generate flight data, use the `flights` template: | ||
|
||
```java | ||
import io.skodjob.datagenerator.DataGenerator; | ||
import io.skodjob.datagenerator.enums.ETemplateType; | ||
public class Main { | ||
public static void main(String[] args) { | ||
DataGenerator dataGenerator = new DataGenerator(ETemplateType.FLIGHTS); | ||
String paymentDataString = dataGenerator.generateStringData(); | ||
JsonNode paymentDataJson = dataGenerator.generateJsonData(); | ||
System.out.println(paymentDataString); | ||
} | ||
} | ||
``` | ||
|
||
To use different templates just change the input parameter for `DataGenerator` and use it in the same way. | ||
|
||
## Templates | ||
|
||
The project currently includes the following templates: | ||
- `payment_data` | ||
- `flights` | ||
- `stargate` | ||
- `starwars` | ||
- `iot_device` | ||
- `payroll` | ||
|
||
Each template corresponds to a specific data domain and generates JSON data that can be used for various testing and development purposes. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure that your code follows the existing style and includes tests for new functionality. | ||
|
||
## License | ||
|
||
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details. | ||
|
||
## Contact | ||
|
||
For any inquiries or issues, please open an issue on the [GitHub repository](https://github.com/skodjob/data-generator). |