Merge "Move getIdent from the SshSession to the TestAccount class"

This commit is contained in:
Edwin Kempin
2013-03-07 13:18:46 +00:00
committed by Gerrit Code Review
3 changed files with 7 additions and 7 deletions

View File

@@ -23,8 +23,6 @@ import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import org.eclipse.jgit.lib.PersonIdent;
public class SshSession {
private final TestAccount account;
@@ -78,8 +76,4 @@ public class SshSession {
b.append(session.getPort());
return b.toString();
}
public PersonIdent getIdent() {
return new PersonIdent(session.getUserName(), account.email);
}
}

View File

@@ -20,6 +20,8 @@ import java.io.ByteArrayOutputStream;
import com.jcraft.jsch.KeyPair;
import org.eclipse.jgit.lib.PersonIdent;
public class TestAccount {
public final Account.Id id;
@@ -44,4 +46,8 @@ public class TestAccount {
sshKey.writePrivateKey(out);
return out.toByteArray();
}
public PersonIdent getIdent() {
return new PersonIdent(username, email);
}
}

View File

@@ -269,7 +269,7 @@ public class PushForReviewIT extends AbstractDaemonTest {
public PushResult to(String ref) throws GitAPIException, IOException {
add(git, FILE_NAME, FILE_CONTENT);
changeId = createCommit(git, sshSession.getIdent(), SUBJECT);
changeId = createCommit(git, admin.getIdent(), SUBJECT);
return pushHead(git, ref);
}
}