Search in sources :

Example 1 with URLRuleDTO

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());
}
Also used : URLRuleDTO(org.simbasecurity.core.service.manager.dto.URLRuleDTO) URLRule(org.simbasecurity.core.domain.URLRule) Test(org.junit.Test)

Example 2 with URLRuleDTO

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;
}
Also used : URLRuleDTO(org.simbasecurity.core.service.manager.dto.URLRuleDTO)

Aggregations

URLRuleDTO (org.simbasecurity.core.service.manager.dto.URLRuleDTO)2 Test (org.junit.Test)1 URLRule (org.simbasecurity.core.domain.URLRule)1