Skip to content

Commit 12b49e9

Browse files
committed
nit
1 parent bf1738b commit 12b49e9

File tree

2 files changed

+34
-37
lines changed

2 files changed

+34
-37
lines changed

client/src/test/java/org/asynchttpclient/util/TestUTF8UrlCodec.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2018 AsyncHttpClient Project. All rights reserved.
3+
*
4+
* This program is licensed to you under the Apache License Version 2.0,
5+
* and you may not use this file except in compliance with the Apache License Version 2.0.
6+
* You may obtain a copy of the Apache License Version 2.0 at
7+
* http://www.apache.org/licenses/LICENSE-2.0.
8+
*
9+
* Unless required by applicable law or agreed to in writing,
10+
* software distributed under the Apache License Version 2.0 is distributed on an
11+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
13+
*/
14+
package org.asynchttpclient.util;
15+
16+
import org.testng.annotations.Test;
17+
18+
import static org.testng.Assert.assertEquals;
19+
20+
public class Utf8UrlEncoderTest {
21+
@Test
22+
public void testBasics() {
23+
assertEquals(Utf8UrlEncoder.encodeQueryElement("foobar"), "foobar");
24+
assertEquals(Utf8UrlEncoder.encodeQueryElement("a&b"), "a%26b");
25+
assertEquals(Utf8UrlEncoder.encodeQueryElement("a+b"), "a%2Bb");
26+
}
27+
28+
@Test
29+
public void testPercentageEncoding() {
30+
assertEquals(Utf8UrlEncoder.percentEncodeQueryElement("foobar"), "foobar");
31+
assertEquals(Utf8UrlEncoder.percentEncodeQueryElement("foo*bar"), "foo%2Abar");
32+
assertEquals(Utf8UrlEncoder.percentEncodeQueryElement("foo~b_ar"), "foo~b_ar");
33+
}
34+
}

0 commit comments

Comments
 (0)