@Test(expected = CommitFailedException.class)
public void testUniqueByTypeKO() throws Exception {
NodeState root = EMPTY_NODE;
// Add index definition
NodeBuilder builder = root.builder();
createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
"fooIndex", true, true, ImmutableSet.of("foo"),
ImmutableSet.of("typeFoo"));
NodeState before = builder.getNodeState();
builder.child("a").setProperty(JCR_PRIMARYTYPE, "typeFoo", Type.NAME)