def METHOD_NAME(tags_to_apply, get_configuration, configure_environment,
                                 restart_syscheckd, wait_for_fim_start):
    '''
    description: Check if the 'wazuh-syscheckd' daemon detects new targets when monitoring a directory with
                 a symlink and its target is changed. For this purpose, the test will create a 'symbolic link'
                 to a file/directory. Then, it will change the target to a directory and create some files
                 inside, expecting all the FIM events. After the events are processed, the test will change
                 the link to its previous target, and finally, it will make file operations and expect FIM events.
    wazuh_min_version: 4.2.0
    tier: 1
    parameters:
        - tags_to_apply:
            type: set
            brief: Run test if matches with a configuration identifier, skip otherwise.
        - get_configuration:
            type: fixture
            brief: Get configurations from the module.
        - configure_environment:
            type: fixture
            brief: Configure a custom environment for testing.
        - restart_syscheckd:
            type: fixture
            brief: Clear the 'ossec.log' file and start a new monitor.
        - wait_for_fim_start:
            type: fixture
            brief: Wait for realtime start, whodata start, or end of initial FIM scan.
    assertions:
        - Verify that FIM events are generated when a monitored 'symbolic link' target
          is changed to a new directory.
        - Verify that FIM events are generated when a monitored 'symbolic link' target
          is reverted to the previous directory.
    input_description: A test case (monitored_file) is contained in external YAML file (wazuh_conf.yaml) which
                       includes configuration settings for the 'wazuh-syscheckd' daemon and, these  are combined
                       with the testing directories to be monitored defined in the common.py module.
    expected_output:
        - r'.*Sending FIM event: (.+)$' ('added' and 'modified' events)
    tags:
        - scheduled
        - time_travel
    '''
    def modify_and_assert(file):
        fim.modify_file_content(testdir1, file, new_content='Sample modification')
        fim.check_time_travel(scheduled, monitor=wazuh_log_monitor)
        ev = wazuh_log_monitor.start(timeout=3, callback=fim.callback_detect_event).result()
        assert 'modified' in ev['data']['type'] and os.path.join(testdir1, file) in ev['data']['path'], \
            f"'modified' event not matching for {testdir1} {file}"
    check_apply_test(tags_to_apply, get_configuration['tags'])
    scheduled = get_configuration['metadata']['fim_mode'] == 'scheduled'
    whodata = get_configuration['metadata']['fim_mode'] == 'whodata'
    file1 = 'regular1'
    file2 = 'regular2'
    # Don't expect an event since it is not being monitored yet
    fim.modify_file_content(testdir1, file2, new_content='Sample modification')
    fim.check_time_travel(scheduled, monitor=wazuh_log_monitor)
    with pytest.raises(TimeoutError):
        event = wazuh_log_monitor.start(timeout=3, callback=fim.callback_detect_event)
        logger.error(f'Unexpected event {event.result()}')
        raise AttributeError(f'Unexpected event {event.result()}')
    # Change the target to the folder and now expect an event
    modify_symlink(testdir1, os.path.join(testdir_link, 'symlink'))
    wait_for_symlink_check(wazuh_log_monitor)
    fim.wait_for_audit(whodata, wazuh_log_monitor)
    modify_and_assert(file2)
    # Modify symlink target, wait for sym_check to update it
    modify_symlink(os.path.join(testdir1, file1), os.path.join(testdir_link, 'symlink'))
    wait_for_symlink_check(wazuh_log_monitor)
    # Wait for audit to reload the rules
    fim.wait_for_audit(whodata, wazuh_log_monitor)
    fim.modify_file_content(testdir1, file2, new_content='Sample modification2')
    fim.check_time_travel(scheduled, monitor=wazuh_log_monitor)
    with pytest.raises(TimeoutError):
        event = wazuh_log_monitor.start(timeout=3, callback=fim.callback_detect_event)
        logger.error(f'Unexpected event {event.result()}')
        raise AttributeError(f'Unexpected event {event.result()}')
    modify_and_assert(file1)