I have an 09 as well. I tested the hood switch by simply holding it down with my thumb and trying to lock the car. In my case, the switch just wasn't being pushed down far enough.
I fixed it for under 5 bucks by buying those non-skid feet (like these) at a hardware store and put it on the hood itself where it contacts the switch. No tools required, 2 minute fix and it's lasted over 3 years
The ones I linked are apparently the smaller ones. Mine is larger