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