Asymptotically Optimal Tests in Markov Processes