Merge pull request #1874 from ZeyuCai/v5-dev

fix flaky test cn.hutool.json.xml.XMLTest#toXmlTest
This commit is contained in:
Golden Looly 2021-10-07 23:27:18 +08:00 committed by GitHub
commit 738f6ce20a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import cn.hutool.json.XML;
import org.junit.Assert;
import org.junit.Test;
import org.hamcrest.CoreMatchers;
public class XMLTest {
@ -14,7 +15,7 @@ public class XMLTest {
.set("aaa", "你好")
.set("键2", "test");
final String s = JSONUtil.toXmlStr(put);
Assert.assertEquals("<aaa>你好</aaa><键2>test</键2>", s);
Assert.assertThat(s, CoreMatchers.anyOf(CoreMatchers.is("<aaa>你好</aaa><键2>test</键2>"), CoreMatchers.is("<键2>test</键2><aaa>你好</aaa>")));
}
@Test