Search in sources :

Example 1 with TimeConditionDTO

use of org.simbasecurity.core.service.manager.dto.TimeConditionDTO in project simba-os by cegeka.

the class ConditionDTOAssemblerTest method testAssembleSingleConditionData.

@Test
public void testAssembleSingleConditionData() {
    TimeCondition condition = createTimeCondition();
    TimeConditionDTO conditionData = (TimeConditionDTO) ConditionDTOAssembler.assemble(condition);
    assertNotNull(conditionData);
    assertEquals(0, conditionData.getId());
    assertEquals(condition.getName(), conditionData.getName());
    assertEquals(condition.getStartCondition(), conditionData.getStartCondition());
    assertEquals(condition.getEndCondition(), conditionData.getEndCondition());
    assertEquals(0, conditionData.getId());
    assertEquals(0, conditionData.getVersion());
}
Also used : TimeConditionDTO(org.simbasecurity.core.service.manager.dto.TimeConditionDTO) TimeCondition(org.simbasecurity.core.domain.condition.TimeCondition) Test(org.junit.Test)

Example 2 with TimeConditionDTO

use of org.simbasecurity.core.service.manager.dto.TimeConditionDTO in project simba-os by cegeka.

the class ConditionDTOAssemblerTest method testAssembleSingleCondition.

@Test
public void testAssembleSingleCondition() {
    TimeConditionDTO condition = createTimeConditionData();
    TimeCondition conditionData = (TimeCondition) ConditionDTOAssembler.assemble(condition);
    assertNotNull(conditionData);
    assertEquals(0, conditionData.getId());
    assertEquals(condition.getName(), conditionData.getName());
    assertEquals(condition.getStartCondition(), conditionData.getStartCondition());
    assertEquals(condition.getEndCondition(), conditionData.getEndCondition());
    assertEquals(0, conditionData.getId());
    assertEquals(0, conditionData.getVersion());
}
Also used : TimeConditionDTO(org.simbasecurity.core.service.manager.dto.TimeConditionDTO) TimeCondition(org.simbasecurity.core.domain.condition.TimeCondition) Test(org.junit.Test)

Example 3 with TimeConditionDTO

use of org.simbasecurity.core.service.manager.dto.TimeConditionDTO in project simba-os by cegeka.

the class ConditionDTOAssembler method assemble.

private static TimeConditionDTO assemble(final TimeCondition condition) {
    final TimeConditionDTO conditionDTO = new TimeConditionDTO();
    applyVersionAndId((AbstractVersionedEntity) condition, conditionDTO);
    conditionDTO.setName(condition.getName());
    conditionDTO.setStartCondition(condition.getStartCondition());
    conditionDTO.setEndCondition(condition.getEndCondition());
    return conditionDTO;
}
Also used : TimeConditionDTO(org.simbasecurity.core.service.manager.dto.TimeConditionDTO)

Example 4 with TimeConditionDTO

use of org.simbasecurity.core.service.manager.dto.TimeConditionDTO in project simba-os by cegeka.

the class ConditionDTOAssemblerTest method createTimeConditionData.

private TimeConditionDTO createTimeConditionData() {
    TimeConditionDTO condition = new TimeConditionDTO();
    condition.setName("time condition");
    condition.setStartCondition("0 0 12 * * ?");
    condition.setEndCondition("0 0 12 * * ?");
    return condition;
}
Also used : TimeConditionDTO(org.simbasecurity.core.service.manager.dto.TimeConditionDTO)

Aggregations

TimeConditionDTO (org.simbasecurity.core.service.manager.dto.TimeConditionDTO)4 Test (org.junit.Test)2 TimeCondition (org.simbasecurity.core.domain.condition.TimeCondition)2