Closed aparra closed 11 years ago
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"); }});
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"); }});