Add unit test for token valid method