Search in sources :

Example 1 with PackageMaterialAgent

use of com.thoughtworks.go.domain.materials.packagematerial.PackageMaterialAgent in project gocd by gocd.

the class MaterialAgentFactoryTest method shouldGetPackageMaterialAgent.

@Test
public void shouldGetPackageMaterialAgent() {
    File workingDirectory = new File("/tmp/workingDirectory");
    MaterialRevision revision = new MaterialRevision(new PackageMaterial(), new Modifications());
    MaterialAgentFactory factory = new MaterialAgentFactory(null, workingDirectory, null, packageRepositoryExtension, scmExtension);
    MaterialAgent agent = factory.createAgent(revision);
    assertThat(agent instanceof PackageMaterialAgent, is(true));
    assertThat(ReflectionUtil.getField(agent, "packageRepositoryExtension"), is(packageRepositoryExtension));
    assertThat(ReflectionUtil.getField(agent, "revision"), is(revision));
    assertThat(ReflectionUtil.getField(agent, "workingDirectory"), is(workingDirectory));
}
Also used : PackageMaterial(com.thoughtworks.go.config.materials.PackageMaterial) PackageMaterialAgent(com.thoughtworks.go.domain.materials.packagematerial.PackageMaterialAgent) PluggableSCMMaterialAgent(com.thoughtworks.go.domain.materials.scm.PluggableSCMMaterialAgent) PackageMaterialAgent(com.thoughtworks.go.domain.materials.packagematerial.PackageMaterialAgent) MaterialRevision(com.thoughtworks.go.domain.MaterialRevision) File(java.io.File) Test(org.junit.Test)

Aggregations

PackageMaterial (com.thoughtworks.go.config.materials.PackageMaterial)1 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)1 PackageMaterialAgent (com.thoughtworks.go.domain.materials.packagematerial.PackageMaterialAgent)1 PluggableSCMMaterialAgent (com.thoughtworks.go.domain.materials.scm.PluggableSCMMaterialAgent)1 File (java.io.File)1 Test (org.junit.Test)1