I'm not a relativity expert, but couldn't you tell the difference between a point mass (or just significantly smaller volume) and a star in this black box scenario? At a great distance, they would appear the same gravitationally, but as you get closer, the star would appear less massive. Since more mass would be pulling on you at an angle, rather than directly toward the center.
Definitely not for classical gravity. https://en.wikipedia.org/wiki/Shell_theorem Point 1 there says that the physical extent of the mass doesn't matter for a spherically symmetric object, to which a star is close enough.