use of org.simbasecurity.core.service.manager.dto.URLRuleDTO in project simba-os by cegeka.
the class RuleDTOAssemblerTest method testAssembleSingleRule_UrlRule.
@Test
public void testAssembleSingleRule_UrlRule() {
URLRule urlRule = createUrlRule();
URLRuleDTO ruleData = (URLRuleDTO) RuleDTOAssembler.assemble(urlRule);
assertNotNull(ruleData);
assertEquals(urlRule.getName(), ruleData.getName());
assertEquals(urlRule.getResourceName(), ruleData.getResourceName());
assertEquals(true, ruleData.isGetAllowed());
assertEquals(true, ruleData.isPostAllowed());
assertEquals(0, ruleData.getId());
assertEquals(0, ruleData.getVersion());
}
use of org.simbasecurity.core.service.manager.dto.URLRuleDTO in project simba-os by cegeka.
the class RuleDTOAssembler method assemble.
public static RuleDTO assemble(final URLRule rule) {
final URLRuleDTO ruleDTO = new URLRuleDTO();
applyVersionAndId((AbstractVersionedEntity) rule, ruleDTO);
applyRuleDTOAssembling(rule, ruleDTO);
ruleDTO.setGetAllowed(rule.isGetAllowed());
ruleDTO.setPostAllowed(rule.isPostAllowed());
return ruleDTO;
}
Aggregations