https://github.com/murdos/easy-random-protobuf
Easy Random protobuf support
https://github.com/murdos/easy-random-protobuf
easy-random java object-mother protobuf random random-generation
Last synced: about 1 year ago
JSON representation
Easy Random protobuf support
- Host: GitHub
- URL: https://github.com/murdos/easy-random-protobuf
- Owner: murdos
- License: apache-2.0
- Created: 2020-12-05T23:39:55.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T08:31:20.000Z (over 2 years ago)
- Last Synced: 2023-10-30T09:31:55.041Z (over 2 years ago)
- Topics: easy-random, java, object-mother, protobuf, random, random-generation
- Language: Java
- Homepage:
- Size: 103 KB
- Stars: 10
- Watchers: 2
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# easy-random-protobuf
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/murdos/easy-random-protobuf/actions)
[](https://repo1.maven.org/maven2/io/github/murdos/easy-random-protobuf/0.3.0/)
[](https://javadoc.io/doc/io.github.murdos/easy-random-protobuf)
Extension for [Easy Random library](https://github.com/j-easy/easy-random) adding support for [Protocol buffers](https://developers.google.com/protocol-buffers).
## Maven
```xml
io.github.murdos
easy-random-protobuf
0.4.0
```
## Usage
This library declares a [SPI provider](https://github.com/j-easy/easy-random/wiki/Grouping-Randomizers), so Easy Random will detect it automatically.
If you want to explicitly use it:
```java
EasyRandomParameters parameters = new EasyRandomParameters()
.randomizerRegistry(new ProtobufRandomizerRegistry());
EasyRandom easyRandom = new EasyRandom(parameters);
Person randomPerson = easyRandom.nextObject(Person.class); // With Person being a generated class from a .proto file
```
### Building
```
$ git clone https://github.com/murdos/easy-random-protobuf.git
$ cd easy-random-protobuf
$ mvn clean install
```