mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
fbd03a88da
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
29 lines
838 B
Groovy
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, [:])
|
|
}
|
|
}
|