oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
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 GMT
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



Mime
View raw message