Search in sources :

Example 1 with MaterialsMother.svnMaterial

use of com.thoughtworks.go.helper.MaterialsMother.svnMaterial in project gocd by gocd.

the class PipelineSqlMapDaoIntegrationTest method shouldPersistMaterialsWithRealPassword.

@Test
public void shouldPersistMaterialsWithRealPassword() throws SQLException {
    MaterialRevisions materialRevisions = new MaterialRevisions();
    addRevision(materialRevisions, MaterialsMother.svnMaterial("http://username:password@localhost"));
    addRevision(materialRevisions, MaterialsMother.hgMaterial("http://username:password@localhost"));
    addRevision(materialRevisions, new GitMaterial("git://username:password@localhost"));
    addRevision(materialRevisions, new P4Material("localhost:1666", "view"));
    BuildCause buildCause = BuildCause.createManualForced(materialRevisions, Username.ANONYMOUS);
    Pipeline pipeline = new Pipeline("Test", buildCause);
    save(pipeline);
    Pipeline loaded = pipelineDao.mostRecentPipeline("Test");
    Materials materials = loaded.getMaterials();
    for (Material material : materials) {
        assertThat(((ScmMaterial) material).getUrl(), not(containsString("******")));
    }
}
Also used : GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) Materials(com.thoughtworks.go.config.materials.Materials) GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) HgMaterial(com.thoughtworks.go.config.materials.mercurial.HgMaterial) MaterialsMother.svnMaterial(com.thoughtworks.go.helper.MaterialsMother.svnMaterial) ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) Material(com.thoughtworks.go.domain.materials.Material) P4Material(com.thoughtworks.go.config.materials.perforce.P4Material) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) P4Material(com.thoughtworks.go.config.materials.perforce.P4Material) BuildCause(com.thoughtworks.go.domain.buildcause.BuildCause) Test(org.junit.Test)

Aggregations

Materials (com.thoughtworks.go.config.materials.Materials)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)1 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)1 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)1 P4Material (com.thoughtworks.go.config.materials.perforce.P4Material)1 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)1 Material (com.thoughtworks.go.domain.materials.Material)1 MaterialsMother.svnMaterial (com.thoughtworks.go.helper.MaterialsMother.svnMaterial)1 Test (org.junit.Test)1