forked from scribejava/scribejava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapUtilsTest.java
More file actions
31 lines (26 loc) · 833 Bytes
/
Copy pathMapUtilsTest.java
File metadata and controls
31 lines (26 loc) · 833 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
29
30
31
package com.github.scribejava.core.utils;
import java.util.LinkedHashMap;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
public class MapUtilsTest {
@Test
public void shouldPrettyPrintMap() {
final Map<Integer, String> map = new LinkedHashMap<>();
map.put(1, "one");
map.put(2, "two");
map.put(3, "three");
map.put(4, "four");
Assert.assertEquals("{ 1 -> one , 2 -> two , 3 -> three , 4 -> four }", MapUtils.toString(map));
}
@Test
public void shouldHandleEmptyMap() {
final Map<Integer, String> map = new HashMap<>();
Assert.assertEquals("{}", MapUtils.toString(map));
}
@Test
public void shouldHandleNullInputs() {
Assert.assertEquals("", MapUtils.toString(null));
}
}