fabricator
==========
[](http://mvnrepository.com/artifact/com.github.azakordonets/fabricator_2.11)
[](https://travis-ci.org/azakordonets/fabricator) [](https://coveralls.io/r/azakordonets/fabricator) [](https://bintray.com/biercoff/Fabricator/fabricator/view?source=watch)
[  ](https://bintray.com/biercoff/Fabricator/fabricator/_latestVersion)
[](https://www.codacy.com/app/biercoff/fabricator)
Fabricator is a minimalist generator of random strings, numbers, etc. to help reduce some monotony particularly while writing automated tests or
anywhere else you need anything random. It's written on scala but fully backward compatible with Java.
## How to install :
For maven projects you need to add next dependency in your \`\`\`pom.xml\`\`\` file :
\`\`\`java
com.github.azakordonetsfabricator_2.132.1.9
\`\`\`
In case you want to use it in your scala project, then just add this lines to your \`\`\`build.sbt\`\`\` file :
*Note* : since version \`2.1.5\` scala 2.10 got deprecated. You can get version \`2.1.4\`, but future fixes and updated
will by only for scala versions 2.11.* and higher
For Scala 2.10.4 you can use this :
\`\`\`scala
resolvers += "Fabricator" at "http://dl.bintray.com/biercoff/Fabricator"
libraryDependencies += "com.github.azakordonets" % "fabricator_2.10" % "2.1.4"
\`\`\`
For Scala 2.11 you can use this :
\`\`\`scala
resolvers += "Fabricator" at "http://dl.bintray.com/biercoff/Fabricator"
libraryDependencies += "com.github.azakordonets" % "fabricator_2.11" % "2.1.5"
\`\`\`
For Scala 2.12 you can use this :
\`\`\`scala
resolvers += "Fabricator" at "http://dl.bintray.com/biercoff/Fabricator"
libraryDependencies += "com.github.azakordonets" % "fabricator_2.12" % "2.1.5"
\`\`\`
For Scala 2.13 you can use this :
\`\`\`scala
// https://mvnrepository.com/artifact/com.github.azakordonets/fabricator
libraryDependencies += "com.github.azakordonets" %% "fabricator_2.13" % "2.1.9"
\`\`\`
Usage
------
Fabricator consist of 9 specific modules :
* Alphanumeric - generates random numbers and strings:
* Calendar - generates random time and date:
* Contact - generates contact and person details information :
* File - generates random csv files
* Finance - generates random credit cards, bsn numbers
* Internet - generates random url's, domains, e-mails, ip's, mac addresses, color codes, social networks id's
* User Agent - generate any random user agent for mobile and desktop client
* Location - generates random coordinates, geohash
* Mobile - generates random mobile platforms push tokens or id's
* Words - generates random words, sentences and even blocks of text
To start using it you need to import fabricator.* and then make a call to appropriate module.
Let's look closer what each module can build :
Alphanumeric
------------
This module allows you to generate any random number or string. As for strings, you can generate either fully random string,
or you can generate string basing on a pattern.
\`\`\`scala
val alpha = fabricator.Alphanumeric() // initialize alpha numeric module
alpha.numerify("###ABC") // 981ABC
alpha.letterify("???123") // LsQ123
alpha.botify("???###") // AbC329
alpha.randomInteger // random integer in 0 to 1000 range
alpha.randomInteger(100) // random integer in 0 to 100 range
alpha.randomInteger(200, 300) // random integer in 200 to 300 range
alpha.randomIntegerRangeAsScalaList(1,10,1) // will return scala List[1,2,3,4,5,6,7,8,9,10]
alpha.randomIntegerRangeAsJavaList(1,10,1) // will return List