* href="https://issues.apache.org/jira/browse/JCR-3069">JCR-3069</a>
*/
public void testAutoFixWithConsistencyCheck() throws Exception {
// new repository
TransientRepository rep = new TransientRepository(new File(TEST_DIR));
Session s = openSession(rep, false);
Node root = s.getRootNode();
// add nodes /test and /test/missing
Node test = root.addNode("test");
Node missing = test.addNode("missing");
missing.addMixin("mix:referenceable");
UUID id = UUID.fromString(missing.getIdentifier());
s.save();
s.logout();
destroyBundle(id, "workspaces/default");
s = openSession(rep, false);
try {
ConsistencyReport r = TestHelper.checkConsistency(s, false);
assertNotNull(r);
assertNotNull(r.getItems());
assertEquals(1, r.getItems().size());
assertEquals(test.getIdentifier(), r.getItems().iterator().next()
.getNodeId());
} finally {
s.logout();
rep.shutdown();
FileUtils.deleteDirectory(new File("repository"));
}
}