1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/test/groovy/com/sap/piper/versioning/ArtifactVersioningTest.groovy
Oliver Nocon fbd03a88da
Step for automatic versioning (#65)
It contains:

* versioning step artifactSetVersion
* versioning implementation for Maven & Docker
* enhancements to commonPipelineEnvironment
* extended default configuration
* new utils object for git-related tasks
* automated tests incl. new Rules and resources
* incorporated PR feedback
* step documentation
2018-02-07 13:17:33 +01:00

29 lines
838 B
Groovy

package com.sap.piper.versioning
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException
import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertEquals
class ArtifactVersioningTest {
@Rule
public ExpectedException thrown = ExpectedException.none()
@Test
void testInstatiateFactoryMethod() {
def versionObj = ArtifactVersioning.getArtifactVersioning( 'maven', this, [:])
assertTrue(versionObj instanceof MavenArtifactVersioning)
}
@Test
void testInstatiateFactoryMethodWithInvalidToolId() {
thrown.expect(IllegalArgumentException)
thrown.expectMessage('No versioning implementation for buildTool: invalid available.')
ArtifactVersioning.getArtifactVersioning('invalid', this, [:])
}
}