@Test void isSameServer_empty() { MockConfigPart part1 = new MockConfigPart() .withUsername("u1") .withServerName("n1:1"); ServerConfig sc = ServerConfig.createFrom(part1); assertTrue(sc.isSameServerConnection(part1)); // Change it in the client ways, and it's still the same server. part1.withClientHostname("h1").withClientname("cc") .withDefaultCharset("a1").withIgnoreFileName("i") .withReloadValue(false); assertTrue(sc.isSameServerConnection(part1)); // Change the user MockConfigPart part2 = part1.copy() .withUsername("u2"); assertFalse(sc.isSameServerConnection(part2)); // change the server name MockConfigPart part3 = part1.copy() .withServerName("n2:1"); assertFalse(sc.isSameServerConnection(part3)); // change the password MockConfigPart part4 = part1.copy() .withPassword("a"); assertFalse(sc.isSameServerConnection(part4)); part4.withNoPassword().withRequiresUserEnteredPassword(true); assertFalse(sc.isSameServerConnection(part4)); }