use of org.simbasecurity.core.service.manager.dto.PolicyDTO in project simba-os by cegeka.
the class PolicyDTOAssemblerTest method testAssembleMultiplePolicies.
@Test
public void testAssembleMultiplePolicies() {
Policy policy = new PolicyEntity("policy name");
Collection<PolicyDTO> policyDataList = PolicyDTOAssembler.assemble(Arrays.asList(policy));
assertNotNull(policyDataList);
assertEquals(1, policyDataList.size());
}
use of org.simbasecurity.core.service.manager.dto.PolicyDTO in project simba-os by cegeka.
the class PolicyDTOAssembler method assemble.
public static PolicyDTO assemble(final Policy policy) {
final PolicyDTO policyDTO = new PolicyDTO();
applyVersionAndId((AbstractVersionedEntity) policy, policyDTO);
policyDTO.setName(policy.getName());
return policyDTO;
}
use of org.simbasecurity.core.service.manager.dto.PolicyDTO in project simba-os by cegeka.
the class PolicyDTOAssemblerTest method testAssembleSinglePolicy.
@Test
public void testAssembleSinglePolicy() {
Policy policy = new PolicyEntity("policy name");
PolicyDTO policyData = PolicyDTOAssembler.assemble(policy);
assertNotNull(policyData);
assertEquals(0, policyData.getId());
assertEquals(policy.getName(), policyData.getName());
assertEquals(0, policyData.getId());
assertEquals(0, policyData.getVersion());
}
Aggregations