我使用一个基于snakeyaml(java)的解析器来编写一个测试用例,但是我不知道如何正确地构建这个图。任何帮助,非常感谢。谢谢。
RuntimeException occured : Cannot load fixture test-data.yml:
org.hibernate.PropertyAccessException: could not get a field value by
reflection getter of models.Priority.description
上面的异常是针对一个不相关的字段,如果我
删除关联
roles:
- roleType: testRoleType
description: desc
如果我把它改成
- !models.Role
roleType: testRoleType
description: desc
无法为构造java对象!模型.角色;异常=onRole
任何帮助,非常感谢。谢谢。
public class Person {
String fullname;
@OneToMany(cascade=CascadeType.ALL)
public List<Role> roles;
}
public class Role {
public RoleType roleType;
public String description;
}
public class RoleType {
public String roleName;
public String description;
}
YAML--
RoleType (testRoleType):
roleName: test
description: desc
Person(administrator):
fullname: Administrator
roles:
- roleType: testRoleType
description: desc