@Test public void shouldConvertToMap() throws Exception { RequestMap expectedMap = new RequestMap(); expectedMap.putMap(new HashMap<String, String>() {{ put("appId", "appId"); put("appKey", "appKey"); }}); RequestMap map = applicationCredential.asMap(); assertEquals(expectedMap, map); }
@Override public RequestMap asMap() { final RequestMap form = new RequestMap(); form.putString("appId", appId); form.putString("appKey", appKey); if(authorizationCode!=null) form.putString("authorizationCode", authorizationCode); return form; }
ApplicationCredential extends Credential { @Override public RequestMap asMap() { final RequestMap form = new RequestMap(); form.putString("appId", appId); form.putString("appKey", appKey); if(authorizationCode!=null) form.putString("authorizationCode", authorizationCode); return form; } }
ApplicationCredential extends Credential { @Override public RequestMap asMap() { final RequestMap form = new RequestMap(); form.putString("appId", appId); form.putString("appKey", appKey); if(authorizationCode!=null) form.putString("authorizationCode", authorizationCode); return form; } ApplicationCredential(String appId, String appKey);   ApplicationCredential(String appId, String appKey, String authorizationCode); }
ApplicationCredential extends Credential { @Override public RequestMap asMap() { final RequestMap form = new RequestMap(); form.putString("appId", appId); form.putString("appKey", appKey); if(authorizationCode!=null) form.putString("authorizationCode", authorizationCode); return form; } ApplicationCredential(String appId, String appKey);   ApplicationCredential(String appId, String appKey, String authorizationCode); @Override RequestMap asMap(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
ApplicationCredential extends Credential { @Override public RequestMap asMap() { final RequestMap form = new RequestMap(); form.putString("appId", appId); form.putString("appKey", appKey); if(authorizationCode!=null) form.putString("authorizationCode", authorizationCode); return form; } ApplicationCredential(String appId, String appKey);   ApplicationCredential(String appId, String appKey, String authorizationCode); @Override RequestMap asMap(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }