コード例 #1
0
  public void testReturnsClientTokenWithNullFieldsFromRandomJson() {
    ClientToken clientToken =
        ClientToken.fromString(FixturesHelper.stringFromFixture(getContext(), "random_json.json"));

    assertNull(clientToken.getConfigUrl());
    assertNull(clientToken.getAuthorizationFingerprint());
  }
コード例 #2
0
  public void testDeserializesFromClientToken() {
    ClientToken clientToken =
        ClientToken.fromString(FixturesHelper.stringFromFixture(getContext(), "client_token.json"));

    assertEquals("client_api_configuration_url", clientToken.getConfigUrl());
    assertEquals("authorization_fingerprint", clientToken.getAuthorizationFingerprint());
  }
コード例 #3
0
  public void testCanDeserializeFromBase64String() {
    ClientToken clientToken =
        ClientToken.fromString(
            FixturesHelper.stringFromFixture(getContext(), "base_64_client_token.txt"));

    assertEquals("encoded_capi_configuration_url", clientToken.getConfigUrl());
    assertEquals("encoded_auth_fingerprint", clientToken.getAuthorizationFingerprint());
  }