Add test for generateApiKey.