mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix test
This commit is contained in:
@@ -9,32 +9,32 @@ import java.util.HashMap;
|
||||
|
||||
public class TolerantMapTest {
|
||||
|
||||
private final TolerantMap<String, String> map = TolerantMap.of(new HashMap<>(), "default");
|
||||
private final TolerantMap<String, String> map = TolerantMap.of(new HashMap<>(), "default");
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
map.put("monday", "星期一");
|
||||
map.put("tuesday", "星期二");
|
||||
}
|
||||
@Before
|
||||
public void before() {
|
||||
map.put("monday", "星期一");
|
||||
map.put("tuesday", "星期二");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerialize() {
|
||||
byte[] bytes = ObjectUtil.serialize(map);
|
||||
TolerantMap<String, String> serializedMap = ObjectUtil.deserialize(bytes);
|
||||
assert serializedMap != map;
|
||||
assert map.equals(serializedMap);
|
||||
}
|
||||
@Test
|
||||
public void testSerialize() {
|
||||
byte[] bytes = ObjectUtil.serialize(map);
|
||||
TolerantMap<String, String> serializedMap = ObjectUtil.deserialize(bytes);
|
||||
assert serializedMap != map;
|
||||
assert map.equals(serializedMap);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClone() {
|
||||
TolerantMap<String, String> clonedMap = ObjectUtil.clone(map);
|
||||
assert clonedMap != map;
|
||||
assert map.equals(clonedMap);
|
||||
}
|
||||
@Test
|
||||
public void testClone() {
|
||||
TolerantMap<String, String> clonedMap = ObjectUtil.clone(map);
|
||||
assert clonedMap != map;
|
||||
assert map.equals(clonedMap);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
assert "星期二".equals(map.get("tuesday"));
|
||||
assert "default".equals(map.get(RandomUtil.randomString(6)));
|
||||
}
|
||||
@Test
|
||||
public void testGet() {
|
||||
assert "星期二".equals(map.get("tuesday"));
|
||||
assert "default".equals(map.get(RandomUtil.randomString(6)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user