Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
douban-scala/src/test/scala/com/douban/models/AuthTest.scala
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (27 sloc)
891 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.douban.models | |
import java.awt.Desktop | |
import java.net.URI | |
import com.douban.common._ | |
/** | |
* Copyright by <a href="http://www.josephjctang.com"><em><i>Joseph J.C. Tang</i></em></a> <br/> | |
* Email: <a href="mailto:jinntrance@gmail.com">jinntrance@gmail.com</a> | |
* @author joseph | |
* @since 12/26/12 10:37 PM | |
* @version 1.0 | |
*/ | |
class AuthTest extends BaseTest { | |
test("the auth url") { | |
val url=new URI(Auth.getAuthUrl(Auth.api_key, Auth.redirect_url)) | |
println(url) | |
Desktop.getDesktop.browse(url) | |
// val codeUrl = readLine("please copy the url here after authorization>\n") | |
// Auth.code = Auth.extractCode(codeUrl) | |
} | |
test("the acess token url") { | |
prettyJSON(Auth.getTokenByCode("3f5bd2951eb79e98", api_key, secret)) | |
} | |
test("the refresh token url") { | |
val t = Auth.getTokenByFresh(refresh_token, api_key, secret) | |
prettyJSON(t) | |
} | |
} |