When the reference distribution is some arbitrary distribution q \in \simplex{k} instead of the uniform distribution, the problem is described as identity testing. The rest of the setup is the same. Thus uniformity testing is a specific example of identity testing. It turns out that if you have an algorithm for uniformity testing, you get one for identity testing for free.


Reduction of Identity Testing to Uniformity Testing

If you have an (\eps)-uniformity tester with sample complexity s(n, \eps), then you can construct an (\eps) identity tester with sample complexity s(6n, \eps/3)

The original proof can be found in (Goldreich, 2016). I was able to re-derive the results here.

Goldreich, O., 2016. The uniform distribution is complete with respect to testing identity to a fixed distribution., in: Electron. Colloquium Comput. Complex. p. 15.