Skip to content
Discussion options

You must be logged in to vote

I should probably document this better. This is because because of precedence for the different methods. These are ranked from highest to lowest:

  • assign()
  • set() and supply()
  • generate()

You can workaround this by changing the model to use generate() instead of set().

Alternatively, you can replace set() with assign() when creating an object from the model:

Account account = Instancio.of(accountModel)
    .assign(Assign.valueOf(Account::getOrder).set(2))
    .create();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mmefremov
Comment options

Answer selected by mmefremov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants