but it involves encryption of the password, is that ok?


On 7 January 2014 17:17, Jesse Glick <notifications@github.com> wrote:

> In src/test/java/hudson/plugins/mercurial/HgExeTest.java:
>
> > +        HgExe hgexe = new HgExe(
> > +                this.mercurialInstallation, credentials,
> > +                this.launcher, this.node,
> > +                this.listener, this.vars);
> > +        ArgumentListBuilder b = hgexe.seed(false);
> > +        Matcher matcher = Pattern.compile("ssh\\s-i\\s(.+)\\s-l\\stestuser").matcher(b.toCommandArray()[2]);
> > +        matcher.find();
> > +        String fileName = matcher.group(1);
> > +        assertEquals("test key", FileUtils.readFileToString(new File(fileName)));
> > +        assertEquals(new ArgumentListBuilder(
> > +                "hg", "--config", "******").toString(),
> > +                b.toString());
> > +    }
> > +
> > +    private static class MockUsernamePasswordCredentials extends BaseStandardCredentials
> > +            implements StandardUsernamePasswordCredentials {
>
> Could probably just use UsernamePasswordCredentialsImpl.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/jenkinsci/mercurial-plugin/pull/48/files#r8697339>
> .
>



-- 
Anatoly Bubenkov