Sync most test case with oauth2 2.1.x, except Model/InMemory/*.