.withServerFingerprint("abcd") .withDefaultCharset("char") .withIgnoreFileName("ignore-these") .withClientHostname("c-host") .withLoginSso("log-sso.cmd -t my_auth");
.withClientHostname("hostname") .withDefaultCharset("charset") .withIgnoreFileName("ignore") .withLoginSso("sso") .withRequiresUserEnteredPassword(true)
.withClientHostname("hostname") .withDefaultCharset("charset") .withIgnoreFileName("ignore") .withLoginSso("sso") .withRequiresUserEnteredPassword(true)
public MockConfigPart copy() { MockConfigPart ret = new MockConfigPart() .withSourceName(sourceName) .withP4ServerName(serverName) .withClientname(clientname) .withUsername(username) .withAuthTicketFile(authTicketFile) .withTrustTicketFile(trustTicketFile) .withServerFingerprint(serverFingerprint) .withClientHostname(clientHostname) .withIgnoreFileName(ignoreFileName) .withDefaultCharset(defaultCharset) .withLoginSso(loginSso) .withReloadValue(reloadValue) .withRequiresUserEnteredPassword(requiresUserEnteredPassword); if (hasPasswordSet) { ret.withPassword(password); } else { ret.withNoPassword(); } return ret; }
.withConfigProblems(createWarning(), createError()) .withDefaultCharset("UTF-8") .withIgnoreFileName(".p4ignore1") .withLoginSso("my-login-sso.sh") .withRequiresUserEnteredPassword(true);
.withClientHostname("host1") .withConfigProblems(createWarning(), createWarning()) .withIgnoreFileName(".p4ignore1") .withRequiresUserEnteredPassword(true); MockConfigPart mockPartLast = new MockConfigPart()
@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)); }