Hi all,

first of all, i appologise if i'm starting a topic that already exists (but
i couldn't find one :-)

i'm having some difficulties with creating test scenarios in guvnor when the
domain model is based on referenced objects.

Suppose we have a model like this one:

Class Role with attributes:

   roleId: Long
   roleName: String

Class User with attributes:

   userId: Long
   userName: String
   firstName: String
   lastName: String
   role: Role

Then, lets suppose the rule like this one (it's pritty simple one)

rule "my first rule"
dialect "mvel"
when
       usr: User(firstName=="John", lastName="Doe", role.roleName="ADMIN" )
then
       usr.userName="ADMIN"
end

Now, i'm trying to create a test scenario for this rule. And my nightmare
begins...

Seems to me that there is no possibility to define referenced object in test
scenario, ie:

GIVEN
           User [usr]
                  firstName = "..."
                  lastName = "..."
                  *role.roleName = "..."*

EXPECTING
..............

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.

Thank you for your answers and suggestions (if any) :-))
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to