Changelog History
-
v4.0.1
April 19, 2016 -
v4.0.0
April 19, 2016 -
v3.1.1
April 19, 2016 -
v3.1.0
July 13, 2015 -
v3.0.0 Changes
January 29, 2015๐ Features
๐
has
andgimme
functions now supports multiple templatesFixture.from(User.class).gimme(2, "male", "female");
Fixture.of(User.class).addTemplate("valid", new Rule() {{ add("addresses", has(2).of(Address.class, "sp", "mg")); }});
โ adding
asString
toinstant
function #58
add("birthdayAsString", instant("18 years ago").asString("dd/MM/yyyy"));
uniqueRandom
function to generate unique values #70CNPJ function #55
add("cnpj", cnpj());
๐ Bugfixes
- ๐ Fixing
range
function withBigDecimal
type #69 - ๐ Fixing fixtures for inner classes with construtors in Java 8 935214c
- ๐ Fixing overriding nested attribute in
gimme
call #73 - And others...
Others
- ๐ Little improvements in documentation
- ๐จ Functions' package was refactored, this will break people that are importing those functions
-
v2.2.0 Changes
April 25, 2014๐ Features
- ๐ Fixtures can now define
Processors
that will run after object instantiation. We already provide aHibernateProcessor
to load generated fixtures into database, making easy to create integration tests
Fixture.from(User.class).uses(new HibernateProcessor(session)).gimme("valid"); //this will generate new User based on valid template and insert it to database through Hibernate
Now we have
TemplateLoader
interface that should be used to declare or templates.public class UserTemplateLoader implements TemplateLoader { @Override public void load() { Fixture.of(User.class).addTemplate("valid", new Rule() {{ add("name", random("Nykolas", "Anderson", "Arthur")); ... }}); } }
๐จ And to load declared templates, we have the new class
FixtureFactoryLoader
that loads all templates in declared package
๐จFixtureFactoryLoader.loadTemplates("br.com.six2six.template");
- ๐ New
random
function toBigDecimal
andBigInteger
add("ammount", random(BigDecimal.class, new MathContext(2)));
๐ Support to override properties definitions on
gimme
call #41Client client = Fixture.from(User.class).gimme("valid", new Rule() {{ add("name", "New name only for this client"); }});
๐ Bugfixes
- ๐ Fixtures can now define
-
v2.1.0
May 20, 2013