<div>Hi all,</div>
<div> </div>
<div>first of all, i appologise if i'm starting a topic that already exists (but i couldn't find one :-)</div>
<div> </div>
<div>i'm having some difficulties with creating test scenarios in guvnor when the domain model is based on referenced objects.</div>
<div> </div>
<div>Suppose we have a model like this one:</div>
<div> </div>
<div>Class Role with attributes:</div>
<div> </div>
<div> roleId: Long</div>
<div> roleName: String</div>
<div> </div>
<div>Class User with attributes:</div>
<div> </div>
<div> userId: Long</div>
<div> userName: String</div>
<div> firstName: String</div>
<div> lastName: String</div>
<div> role: Role</div>
<div> </div>
<div>Then, lets suppose the rule like this one (it's pritty simple one)</div>
<div> </div>
<div>rule "my first rule"</div>
<div>dialect "mvel"</div>
<div>when</div>
<div> usr: User(firstName=="John", lastName="Doe", role.roleName="ADMIN" )</div>
<div>then</div>
<div> usr.userName="ADMIN"</div>
<div>end</div>
<div> </div>
<div>Now, i'm trying to create a test scenario for this rule. And my nightmare begins...</div>
<div> </div>
<div>Seems to me that there is no possibility to define referenced object in test scenario, ie:</div>
<div> </div>
<div>GIVEN </div>
<div> User [usr]</div>
<div> firstName = "..."</div>
<div> lastName = "..."</div>
<div> <strong><font color="#ff0000">role.roleName = "..."</font></strong></div>
<div> </div>
<div>EXPECTING</div>
<div>..............</div>
<div> </div>
<div>Hope that you can understand what i'm talking about. Can somebody (pretty please) give me some directions how to achieve something like this in test scenarios.</div>
<div> </div>
<div>Thank you for your answers and suggestions (if any) :-))</div>
<div> </div>
<div> </div>
<div> </div>