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, (policy.getSpecification(SyncPolicySpec.class)).getUserJavaRule());
assertEquals(syncRRuleName, (policy.getSpecification(SyncPolicySpec.class)).getRoleJavaRule());
}