Return-Path: X-Original-To: apmail-oltu-commits-archive@www.apache.org Delivered-To: apmail-oltu-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96252F1F1 for ; Mon, 13 May 2013 21:08:23 +0000 (UTC) Received: (qmail 27011 invoked by uid 500); 13 May 2013 20:41:42 -0000 Delivered-To: apmail-oltu-commits-archive@oltu.apache.org Received: (qmail 26989 invoked by uid 500); 13 May 2013 20:41:42 -0000 Mailing-List: contact commits-help@oltu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oltu.apache.org Delivered-To: mailing list commits@oltu.apache.org Received: (qmail 26982 invoked by uid 99); 13 May 2013 20:41:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 20:41:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 20:41:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C59F82388962; Mon, 13 May 2013 20:41:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1482093 - in /oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org: ./ apache/ apache/oltu/ apache/oltu/commons/ apache/oltu/commons/AccessTokenResponseTestCase.java Date: Mon, 13 May 2013 20:41:20 -0000 To: commits@oltu.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130513204120.C59F82388962@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Mon May 13 20:41:20 2013 New Revision: 1482093 URL: http://svn.apache.org/r1482093 Log: initial checkin of AccessTokenResponseTestCase class Added: oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/ oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/ oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/ oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/ oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java (with props) Added: oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java?rev=1482093&view=auto ============================================================================== --- oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java (added) +++ oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java Mon May 13 20:41:20 2013 @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.oltu.commons; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public final class AccessTokenResponseTestCase +{ + + @Test + public void fromJson() + { + String source = "{\"access_token\":\"2YotnFZFEjr1zCsicMWpAA\",\"token_type\":\"example\",\"expires_in\":3600,\"refresh_token\":\"tGzv3JOkF0XG5Qx2TlKWIA\",\"example_parameter\":\"example_value\"}"; + + AccessTokenResponse response = AccessTokenResponse.Utils.parseJson( source ); + + assertEquals( "2YotnFZFEjr1zCsicMWpAA", response.getAccessToken() ); + assertEquals( "example", response.getTokenType() ); + assertTrue( 3600 == response.getExpiresIn() ); + assertEquals( "tGzv3JOkF0XG5Qx2TlKWIA", response.getRefreshToken() ); + assertEquals( "example_value", response.getAuxParameter( "example_parameter" ) ); + } + +} Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: oltu/whiteboard/simonetripodi/oltu-commons/src/test/java/org/apache/oltu/commons/AccessTokenResponseTestCase.java ------------------------------------------------------------------------------ svn:mime-type = text/plain