@Test
void doNotDeletePermissionValidReference() {

	assertThat(storageMock.getAllExecutions()).isEmpty();
	final ManagedQuery managedQuery = createManagedQuery();
	// Saving the Execution
	User user = new User("test", "test");
	storageMock.updateUser(user);
	user.addPermission(storageMock, QueryPermission.onInstance(AbilitySets.QUERY_CREATOR, managedQuery.getId()));
	
	QueryCleanupTask.deleteQueryPermissionsWithMissingRef(storageMock, storageMock.getAllUsers());
	
	assertThat(user.getPermissions()).containsOnly(QueryPermission.onInstance(AbilitySets.QUERY_CREATOR, managedQuery.getId()));
	
}