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();
}
Aggregations