Search in sources :

Example 1 with PluggableSCMMaterialAgent

use of com.thoughtworks.go.domain.materials.scm.PluggableSCMMaterialAgent in project gocd by gocd.

the class MaterialAgentFactoryTest method shouldGetPluggableSCMMaterialAgent.

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

Aggregations

PluggableSCMMaterial (com.thoughtworks.go.config.materials.PluggableSCMMaterial)1 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)1 PluggableSCMMaterialAgent (com.thoughtworks.go.domain.materials.scm.PluggableSCMMaterialAgent)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1