If I were to cast a spell on a creature that causes it to become frightened of me and spend all of its movement getting away from me, would that count as "moving willingly" for the purpose of triggering effects like Booming Blade's secondary feature?
This could be viewed from two angles. Either, you are forcing the creature to move, rendering its movement "unwilling" - or you have frightened the creature so much that it wants to get away from you, thereby rendering the movement "willing", to some extent.
Note that, while they also don't trigger on forced movement, opportunity attacks still trigger on frightened, fleeing creatures (whether willing or not), since the description specifically states "You also don't provoke an opportunity attack when [...] something moves you without using your movement, action or reaction".
In this question, which was about 4e (!), the consensus seems to be that running away due to a magical fear effect would not be willing. However, I don't see what would be the logic behind Booming Blade taking into account that a creature moves out of fear. Does the spell "decide" "Hey, this guy wouldn't have moved if he hadn't been enchanted. Let's not deal damage"? Hardly.
Spells that could be part of a situation where this is relevant:
[...] If the target willingly moves before then, it immediately takes 1d8 thunder damage, and the spell ends. [...]
[...] While frightened by this spell a creature must take the Dash action and move away from you by the safest available route on each of its turns unless there is nowhere to move. [...]
Thanks in advance!