If you want to be cheap, and if you can get the stem + out of the cap (will need to awyways, unless you have a new cap) you could, very carefully, rough up the plastic on both surfaces, and repair with super glue, or epoxy. JB weld's quick version would probably be easy and strong, you'd only need to hold it a minute and could type in a day. And then replace if if fails.
You could even use glue to pull the part out of the cap, or if you write off the cap and switch as a total loss otherwise, just glue the cap on as-is.
I know you said you're just replacing, but, I figure the worst that could happen if the fix doesn't hold is you still have to replace.....