Package com.nimbusds.oauth2.sdk.token

Source Code of com.nimbusds.oauth2.sdk.token.RefreshTokenTest

package com.nimbusds.oauth2.sdk.token;


import junit.framework.TestCase;

import com.nimbusds.jose.util.Base64;


/**
* Tests the refresh token class.
*/
public class RefreshTokenTest extends TestCase {


  public void testValueConstructor() {

    RefreshToken rt = new RefreshToken("abc");
    assertEquals("abc", rt.getValue());
    assertTrue(rt.getParamNames().contains("refresh_token"));
    assertEquals(1, rt.getParamNames().size());
  }


  public void testGeneratorConstructor() {

    RefreshToken rt = new RefreshToken(16);
    assertEquals(16, new Base64(rt.getValue()).decode().length);
    assertTrue(rt.getParamNames().contains("refresh_token"));
    assertEquals(1, rt.getParamNames().size());
  }
}
TOP

Related Classes of com.nimbusds.oauth2.sdk.token.RefreshTokenTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.