You don't normally need to use mocks with JSFUnit. Since you are in container and you are running the real JSF implementation you just use the real component references.
I don't know why your mock doesn't return the ID you set for it. That's up to the mock implementation. Is there some reason you think it has to do with the JSFUnit environment?
Actually I just need some standalone, concrete UIComponent to pass along to a JSF component event in a unit test and since I already had JSFUnit as a dependency I thought I could get away with the snippet I posted but apparently it's not designed for isolated usage like that (the setter/getter don't appear to be directly linked to a field in the implementation).