policyDAO.save(policy);
}
@Test
public void create() {
SyncPolicy policy = new SyncPolicy();
final String syncURuleName = "net.tirasa.sync.correlation.TirasaURule";
final String syncRRuleName = "net.tirasa.sync.correlation.TirasaRRule";
SyncPolicySpec syncPolicySpec = new SyncPolicySpec();
syncPolicySpec.setUserJavaRule(syncURuleName);
syncPolicySpec.setRoleJavaRule(syncRRuleName);
policy.setSpecification(syncPolicySpec);
policy.setDescription("Sync policy");
policy = policyDAO.save(policy);
assertNotNull(policy);
assertEquals(PolicyType.SYNC, policy.getType());
assertEquals(syncURuleName, ((SyncPolicySpec) policy.getSpecification()).getUserJavaRule());
assertEquals(syncRRuleName, ((SyncPolicySpec) policy.getSpecification()).getRoleJavaRule());
}