diff --git a/jraft-core/src/test/java/com/alipay/sofa/jraft/conf/ConfigurationTest.java b/jraft-core/src/test/java/com/alipay/sofa/jraft/conf/ConfigurationTest.java index cb48fceca..0fca94f2b 100644 --- a/jraft-core/src/test/java/com/alipay/sofa/jraft/conf/ConfigurationTest.java +++ b/jraft-core/src/test/java/com/alipay/sofa/jraft/conf/ConfigurationTest.java @@ -28,6 +28,19 @@ public class ConfigurationTest { + @Test + public void testToStringParseEmpty() { + final String confStr = ""; + final Configuration conf = JRaftUtils.getConfiguration(confStr); + assertTrue(conf.isEmpty()); + assertEquals("", conf.toString()); + final Configuration newConf = new Configuration(); + assertFalse(newConf.parse(conf.toString())); + assertEquals(confStr, newConf.toString()); + assertEquals(conf.hashCode(), newConf.hashCode()); + assertEquals(conf, newConf); + } + @Test public void testToStringParseStuff() { final String confStr = "localhost:8081,localhost:8082,localhost:8083";