TokenBridge implements LockReactBridge { public WritableMap toMap() { WritableMap tokenMap = null; if (token != null) { tokenMap = Arguments.createMap(); tokenMap.putString(ACCESS_TOKEN_KEY, token.getAccessToken()); tokenMap.putString(ID_TOKEN_KEY, token.getIdToken()); tokenMap.putString(REFRESH_TOKEN_KEY, token.getRefreshToken()); tokenMap.putString(TYPE_KEY, token.getType()); } return tokenMap; } TokenBridge(@Nullable Token token); WritableMap toMap();  }
@Test public void testAll() throws Exception { Token token = new Token("id-token-value", "access-token-value", "type-value", "refresh-token-value"); TokenBridge tokenBridge = new TokenBridge(token); ReadableMap map = tokenBridge.toMap(); assertThat(map.getString("idToken"), is(equalTo("id-token-value"))); assertThat(map.getString("accessToken"), is(equalTo("access-token-value"))); assertThat(map.getString("type"), is(equalTo("type-value"))); assertThat(map.getString("refreshToken"), is(equalTo("refresh-token-value"))); }