ImmutableNodeItemTest: add test for Nodes::asImmutable for non-root
This commit is contained in:
parent
2226d61b46
commit
012cf7cdbf
1 changed files with 9 additions and 0 deletions
|
@ -418,4 +418,13 @@ public class ImmutableNodeItemTest {
|
||||||
//when
|
//when
|
||||||
immutableNode.insertInPath(null, "");
|
immutableNode.insertInPath(null, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void AsImmutableShouldThrowIAEWhenNotRoot() {
|
||||||
|
//given
|
||||||
|
exception.expect(IllegalArgumentException.class);
|
||||||
|
exception.expectMessage("source must be the root node");
|
||||||
|
//when
|
||||||
|
Nodes.asImmutable(Nodes.unnamedChild("child", Nodes.unnamedRoot("root")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue