private void resetOrDelete(CrudRepository<?, ?> repo) {
		if (mockUtil.isMock(repo)) {
			Mockito.reset(new Object[] { repo });
		}
		else {
			try {
				repo.deleteAll();
			}
			catch (ZooKeeperAccessException e) {
				if (e.getCause() instanceof NoNodeException) {
					// ignore if the deleteAll() throws NoNodeException
					return;
				}
			}
		}
	}
Conditional resetting in case the dependency has been overridden and is not actually a mock.
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/AbstractControllerIntegrationTest.java