aparra/fixture-factory — Issue #4: Default template
Author: aparra
Created: 2012-03-03 15:18:49+00:00
State: open

Create default template that allows override properties. Example:

Fixture.of(Address.class).addTemplate("sao_paulo", new Rule(){{
add("id", random(Long.class, range(1L, 100L)));
add("street", random("Paulista Avenue", "Ibirapuera Avenue"));
add("city", "São Paulo");
add("state", "${city}");
add("country", "Brazil");
add("zipCode", random("06608000", "17720000"));
}});

otherwise extends the sao_paulo template:

Fixture.of(Address.class).addTemplate("barueri").extends("sao_paulo", new Rule(){{
add("city", "Barueri");
add("state", "Sao Paulo");
}});