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/SbtArtifactVersioningTest.groovy
Oliver Nocon 65b582dc9d
artifactSetVersion - add new artifact types & cleanup (#242)
* artifactSetVersion - add new artifact types & cleanup

added:
* dlang
* golang
* npm
* pip
* scala

* add documentation update
2018-08-08 22:21:26 +02:00

33 lines
985 B
Groovy

package com.sap.piper.versioning
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
import util.BasePiperTest
import util.JenkinsReadJsonRule
import util.JenkinsWriteJsonRule
import util.Rules
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue
class SbtArtifactVersioningTest extends BasePiperTest{
JenkinsReadJsonRule jrjr = new JenkinsReadJsonRule(this, 'test/resources/versioning/SbtArtifactVersioning/')
JenkinsWriteJsonRule jwjr = new JenkinsWriteJsonRule(this)
@Rule
public RuleChain ruleChain = Rules
.getCommonRules(this)
.around(jrjr)
.around(jwjr)
@Test
void testVersioning() {
SbtArtifactVersioning av = new SbtArtifactVersioning(nullScript, [filePath: 'sbtDescriptor.json'])
assertEquals('1.2.3', av.getVersion())
av.setVersion('1.2.3-20180101')
assertTrue(jwjr.files['sbtDescriptor.json'].contains('1.2.3-20180101'))
}
}