That this works for a test mass is essentially a postulate, which, as indicated by Alexey Bobrick's answer, is related to the equivalence principle.
On the other hand, it is hypothesized that this behaviour can actually be demonstrated to be a direct consequence of Einstein's equations for physical masses. To prove this, however, requires actually solving the full Einstein's equations, and progress in that direction is, to the best of my knowledge, incomplete. The following is a biased (and certainly incomplete) account of some which has been done.
One of the first attacks of the problem came from Einstein himself. In a joint work of Infeld and Hoffman, the point particle is treated as a point (Dirac $\delta$) singularity in space-time. Einstein's equation is written down, and expanded in the Newtonian limit. The resulting series expansion is shown to have the first term corresponding to geodesic motion, and the second term giving the first relativistic correction (which can be used to account for the perihelion precession).
The problem was raised again by Geroch and Jang in 1975. In that paper matter is treated simply as its energy momentum tensor. That is, matter is considered to be represented by a symmetric divergence-free two-tensor (the right hand side of Einstein's equation) that satisfies some energy conditions. The main result of that paper is that if $\gamma$ is a space-time curve such that for every neighborhood $U$ of $\gamma$, there exists a symmetric divergence-free two-tensor that vanishes outside of $U$ and yet is not everywhere vanishing, then $\gamma$ is a time-like geodesic. (One should also see this paper of Weatherall for some further comments.)
The Geroch-Jang theorem has been revisited and generalised by Ehlers and Geroch in 2004. It is interesting to note, as a side remark, that an analog of the Geroch-Jang theorem is also true in Newton-Cartan theories of gravity; this result is due to Weatherall.
A different approach to the problem was taken by DMA Stuart. He considered a specific matter model (in his case, the semilinear wave equation which is known to admit soliton solutions) and showed that solitons in the gravitationally-coupled theory travel along time-like geodesics. The relevant references are this paper and this other paper both from 2004. (Warning: heavy doses of PDE theory is involved in both.)
A yet different point-of-view was given by Gralla and Wald. In that paper they considered a point-particle as a scaling limit of a family of metrics corresponding to solutions of Einstein's equations possessing a coherent body or a black hole, and derived an equation of motion for the limiting particle. The point of view was also taken up by Iva Stavrov where initial data sets generating such a family were constructed. In some sense this method is the rigorous counterpart to the original work of Einstein-Infeld-Hoffman mentioned above.
Remark: Any omissions from the above represent the limits of my own knowledge; it is quite likely that there are other large bodies of work regarding the geodesic hypothesis I am not familiar with. Unfortunately the phrase "geodesic hypothesis" has two distinct meanings in theoretical physics that I am aware of. One is the above in general relativity. The other refers to a hypothesis (due to M.F. Atiyah and N.S. Manton) in high energy physics that the dynamics of solitons can be described by geodesics on a certain moduli space of solutions. So it can be a bit confusing for doing literature search.