    @Test
    public void testBeforeUpdate() throws RepositoryException, InterruptedException {

        IndexInfo inclusion = createMockIndexInfo("include", true);
        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        RecordEvent recordEvent = new RecordEvent();
        recordEvent.setType(Type.UPDATE);
        recordEvent.setTableName(Table.RECORD.name);

        indexFilterHook.beforeUpdate(newRecord, oldRecord, repository, fieldTypes, recordEvent);

        IndexRecordFilterData idxFilterData = recordEvent.getIndexRecordFilterData();
        assertTrue(idxFilterData.getOldRecordExists());
        assertTrue(idxFilterData.getNewRecordExists());
        verify(indexFilterHook).calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, idxFilterData);
    }