ItEr34S08ValidacionEProbasFuncionaisItEr33S08: Providing the type is always necessary
This commit is contained in:
parent
112d941474
commit
c9164d982b
3 changed files with 4 additions and 3 deletions
|
|
@ -98,7 +98,7 @@ public abstract class OrderElement extends BaseEntity {
|
|||
List<SchedulingState> childrenStates = getChildrenStates();
|
||||
SchedulingState result = childrenStates.isEmpty() ? new SchedulingState(
|
||||
getSchedulingStateType())
|
||||
: new SchedulingState(childrenStates);
|
||||
: new SchedulingState(schedulingStateType, childrenStates);
|
||||
result.addTypeChangeListener(new ITypeChangedListener() {
|
||||
@Override
|
||||
public void typeChanged(Type newType) {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,8 @@ public class SchedulingState {
|
|||
public SchedulingState() {
|
||||
}
|
||||
|
||||
public SchedulingState(List<SchedulingState> children) {
|
||||
public SchedulingState(Type type, List<SchedulingState> children) {
|
||||
this(type);
|
||||
for (SchedulingState each : children) {
|
||||
if (!each.isRoot()) {
|
||||
throw new IllegalArgumentException(each
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class SchedulingStateTest {
|
|||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void cannotCreateASchedulingStateWithChildrenAlreadyAssigned() {
|
||||
new SchedulingState(Arrays.asList(childA));
|
||||
new SchedulingState(Type.NO_SCHEDULED, Arrays.asList(childA));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue