Users { public SessionKey code2Session(String code) { String url = WxEndpoint.get("url.user.code2session"); String sessionKey = wxClient.get(String.format(url, wxClient.getClientId(), wxClient.getClientSecret(), code)); logger.debug("code to session key: {}", sessionKey); return JsonMapper.nonEmptyMapper().fromJson(sessionKey, SessionKey.class); }  static Users defaultUsers(); static Users with(AppSetting appSetting); void setWxClient(WxClient wxClient); SessionKey code2Session(String code);  }
@Test @Ignore public void testCode2Session() { SessionKey sessionKey = Users.with(new AppSetting("appid", "screctkey")) .code2Session("011RedXY1NegvX0eLWXY1vVfXY1RedXu"); assertNotNull(sessionKey); }