Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array support #86

Open
ViictrP opened this issue Mar 2, 2016 · 3 comments
Open

Array support #86

ViictrP opened this issue Mar 2, 2016 · 3 comments

Comments

@ViictrP
Copy link

ViictrP commented Mar 2, 2016

Array support

the following code returns an error: no such attribute: enderecos[java.util.ArrayList]
there is no support for arrays, instead supports both array and ArrayList.

Fixture.of(Empresa.class).addTemplate("empresa_valida", new Rule(){ { add("enderecos", has(3).of(Endereco.class, "endereco_valido")); } });

@maurcarvalho
Copy link
Contributor

@ViictrP could you please provide your Fixtures declarations?
Thank you!

@ViictrP
Copy link
Author

ViictrP commented Mar 3, 2016

public class Empresa {

private Endereco[] enderecos;

public Endereco[] getEnderecos(){
        return enderecos;
    }

    public void setEnderecos(Endereco[] enderecos){
        this.enderecos = enderecos;
    }
}

Fixture.of(Endereco.class).addTemplate("endereco_valido", new Rule() {
            {
                add("tipoLogradouro", random("Rua","Avenida","Av","Alameda","Travessa"));
                add("logradouro", random("Padre Estevão Pernet", "Tuiutí"));
                add("numero", random("215", "200", "210","230"));
                add("cep", random("08200222", "03512366", "03500010","03899222"));
                add("bairro", random("Tatuapé", "Itaquera", "Patriarca","Artur Alvim"));
                add("cidade", random("São Paulo", "Osasco", "Barueri","Guarulhos"));
                add("uf", random("SP", "RJ", "ES","MG"));
                add("pais", random("Brasil", "Bulgária", "Bósnia-Herzegovina","Paquistão"));
            }
        });

@rodrigogs
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants