Added test case for json serialization with role.