Created
July 4, 2017 13:28
-
-
Save novachevskyi/71529d8fdecf120e626af227193a9e0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.novachevskyi.okhttptest; | |
import org.junit.Test; | |
import okhttp3.HttpUrl; | |
import static org.junit.Assert.assertEquals; | |
public class OkHttpBug { | |
@Test | |
public void test() throws Exception { | |
HttpUrl.Builder builder = HttpUrl.parse("https://www.google.com/").newBuilder(); | |
builder.addEncodedPathSegment("mobile"); | |
builder.addEncodedPathSegment("#!"); | |
builder.addEncodedPathSegment("id"); | |
builder.addQueryParameter("platform", "android"); | |
String url = builder.build().toString(); | |
assertEquals("https://www.google.com/mobile/#!/id?platform=android", url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment