The rules are different for criminal cases and civil cases and also what sort of testimony you are given. Expert witnesses, for example, who are not employees of the government always tend be paid by the party who wants to the to testify. Government employees (in their official capacity) are usually paid by their employer. There's nobody whose going to reimburse a PARTY in the civil case for his appearance.

