Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devskiller/jfairy
Java fake data generator
https://github.com/devskiller/jfairy
android groovy java test-data-generator
Last synced: 2 days ago
JSON representation
Java fake data generator
- Host: GitHub
- URL: https://github.com/devskiller/jfairy
- Owner: Devskiller
- License: apache-2.0
- Created: 2013-10-07T18:48:28.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-18T15:13:31.000Z (9 months ago)
- Last Synced: 2024-12-15T06:00:27.763Z (10 days ago)
- Topics: android, groovy, java, test-data-generator
- Language: Java
- Homepage: http://devskiller.github.io/jfairy/
- Size: 1.7 MB
- Stars: 742
- Watchers: 34
- Forks: 143
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jFairy by Devskiller
[![Build Status](https://travis-ci.org/Devskiller/jfairy.svg?branch=master)](https://travis-ci.org/Devskiller/jfairy) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.devskiller/jfairy/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.devskiller/jfairy) [![Javadocs](http://www.javadoc.io/badge/com.devskiller/jfairy.svg)](http://www.javadoc.io/doc/com.devskiller/jfairy) [![Coverage Status](https://img.shields.io/coveralls/Devskiller/jfairy.svg)](https://coveralls.io/r/Devskiller/jfairy)
[![Stack Overflow](https://img.shields.io/badge/stack%20overflow-jfairy-4183C4.svg)](https://stackoverflow.com/questions/tagged/jfairy)
[![Join the chat at https://gitter.im/Codearte/jfairy](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Codearte/jfairy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)Java fake data generator. Based on Wikipedia:
> Fairyland, in folklore, is the fabulous land or abode of fairies or fays.
## Try jFairy online!
https://devskiller.com/datafairy/
## Usage
Creating simple objects:
```java
Fairy fairy = Fairy.create();
Person person = fairy.person();System.out.println(person.getFirstName());
// Chloe Barker
System.out.println(person.getEmail());
// [email protected]
System.out.println(person.getTelephoneNumber());
// 690-950-802Person adultMale = fairy.person(PersonProperties.male(), PersonProperties.minAge(21));
System.out.println(adultMale.isMale());
// true
System.out.println(adultMale.getDateOfBirth());
// at least 21 years earlier
```Creating related objects:
```java
Fairy fairy = Fairy.create();
Company company = fairy.company();
System.out.println(company.getName());
// Robuten Associates
System.out.println(company.getUrl());
// http://www.robuteniaassociates.comPerson salesman = fairy.person(PersonProperties.withCompany(company));
System.out.println(salesman.getFullName());
// Juan Camacho
System.out.println(salesman.getCompanyEmail());
// [email protected]
```Locale support:
```java
Fairy enFairy = Fairy.create();
// Locale.ENGLISH is default
Fairy plFairy = Fairy.create(Locale.forLanguageTag("pl"));
// Polish version
```## Other samples
Look into [code samples](https://github.com/Devskiller/jfairy/tree/master/src/test/groovy/snippets/)
## Building
This project can be built using maven command:
./mvnw install