Skip to content

Commit

Permalink
Add testToStringParseEmpty Test
Browse files Browse the repository at this point in the history
  • Loading branch information
caicancai committed Jun 23, 2024
1 parent b401b94 commit f94703a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit f94703a

Please sign in to comment.