@Test
public void testAsDocumentRefreshToken() {

	UserInfo userInfo = new UserInfo(new Subject("sso"));
	
	Date created = new Date();
	TokenDocument<RefreshToken> tokenDocument = new TokenDocument<RefreshToken>(new RefreshToken("lOZugWbWUN2rKborv-QqnZWlpAx2w3c_lP_89e89QVE"), created, new ClientID("TESTCLIENTID"), new LoginSessionToken("XXX"), userInfo);
	Document mongoDocument = tokenDocument.asDocument();
	
	
	assertEquals("lOZugWbWUN2rKborv-QqnZWlpAx2w3c_lP_89e89QVE", mongoDocument.get("_id"));
	assertEquals(created, mongoDocument.getDate("created"));
	assertEquals("TESTCLIENTID", mongoDocument.getString("clientId"));
	assertEquals("sso", ((Map<String, Object>)mongoDocument.get("userInfo")).get("sub"));
	assertEquals("REFRESH", mongoDocument.get("type"));
	assertEquals("XXX", mongoDocument.get("sessionId"));
	assertEquals(Long.MAX_VALUE, mongoDocument.getDate("expires").getTime());
}