forked from goshippo/shippo-java-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpUtilTest.java
More file actions
28 lines (21 loc) · 727 Bytes
/
HttpUtilTest.java
File metadata and controls
28 lines (21 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.shippo.model;
import static org.junit.Assert.assertEquals;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.junit.Test;
import com.shippo.util.HttpUtil;
public class HttpUtilTest {
@Test
public void testOne() throws UnsupportedEncodingException {
Map<String, String> params = HttpUtil.queryToParams("page=1");
assertEquals(params.size(), 1);
assertEquals(params.get("page"), "1");
}
@Test
public void testMany() throws UnsupportedEncodingException {
Map<String, String> params = HttpUtil.queryToParams("page=1&results=completed");
assertEquals(params.size(), 2);
assertEquals(params.get("page"), "1");
assertEquals(params.get("results"), "completed");
}
}