Search in sources :

Example 26 with ScmMaterial

use of com.thoughtworks.go.config.materials.ScmMaterial in project gocd by gocd.

the class MaterialUpdateServiceTest method shouldAllowPostCommitNotificationsToPassThroughToTheQueue_WhenTheSameMaterialIsNotCurrentlyInProgressAndMaterialIsAutoUpdateFalse.

@Test
public void shouldAllowPostCommitNotificationsToPassThroughToTheQueue_WhenTheSameMaterialIsNotCurrentlyInProgressAndMaterialIsAutoUpdateFalse() throws Exception {
    ScmMaterial material = mock(ScmMaterial.class);
    when(material.isAutoUpdate()).thenReturn(false);
    MaterialUpdateMessage message = new MaterialUpdateMessage(material, 0);
    doNothing().when(queue).post(message);
    // first call to the method
    service.updateMaterial(material);
    verify(queue, times(1)).post(message);
    verify(material, never()).isAutoUpdate();
}
Also used : MaterialUpdateMessageMatcher.matchMaterialUpdateMessage(com.thoughtworks.go.helper.MaterialUpdateMessageMatcher.matchMaterialUpdateMessage) ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) Test(org.junit.Test)

Aggregations

ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)26 Test (org.junit.Test)24 Modification (com.thoughtworks.go.domain.materials.Modification)6 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)5 MaterialUpdateMessageMatcher.matchMaterialUpdateMessage (com.thoughtworks.go.helper.MaterialUpdateMessageMatcher.matchMaterialUpdateMessage)5 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 PackageMaterialInstance (com.thoughtworks.go.domain.materials.packagematerial.PackageMaterialInstance)4 PluggableSCMMaterialInstance (com.thoughtworks.go.domain.materials.scm.PluggableSCMMaterialInstance)4 SvnMaterialInstance (com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance)4 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)3 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 RunIf (com.googlecode.junit.ext.RunIf)2 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)2 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)2 PipelineLabel (com.thoughtworks.go.domain.label.PipelineLabel)2 Material (com.thoughtworks.go.domain.materials.Material)2 TransactionStatus (org.springframework.transaction.TransactionStatus)2 TransactionCallbackWithoutResult (org.springframework.transaction.support.TransactionCallbackWithoutResult)2