use of org.simbasecurity.core.domain.condition.TimeCondition in project simba-os by cegeka.
the class ConditionDTOAssemblerTest method createTimeCondition.
private TimeCondition createTimeCondition() {
TimeCondition condition = new TimeCondition();
condition.setName("time condition");
condition.setStartCondition("0 0 12 * * ?");
condition.setEndCondition("0 0 12 * * ?");
return condition;
}
use of org.simbasecurity.core.domain.condition.TimeCondition 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());
}
use of org.simbasecurity.core.domain.condition.TimeCondition 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());
}
use of org.simbasecurity.core.domain.condition.TimeCondition in project simba-os by cegeka.
the class ConditionDTOAssembler method assemble.
private static Condition assemble(final TimeConditionDTO condition) {
final Condition timeCondition = new TimeCondition(condition.getStartCondition(), condition.getEndCondition());
timeCondition.setName(condition.getName());
return timeCondition;
}
Aggregations