mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
Merge pull request #294 from marcusholl/pr/premoveDeclarationsOfPrepareObjectInterceptors
Remove not (really) needed declarations of prepareObjectInterceptors
This commit is contained in:
commit
657ccf7d91
@ -156,11 +156,4 @@ class ArtifactSetVersionTest extends BasePiperTest {
|
||||
)
|
||||
assertThat(sshAgentList, hasItem('testCredentials'))
|
||||
}
|
||||
|
||||
void prepareObjectInterceptors(object) {
|
||||
object.metaClass.invokeMethod = helper.getMethodInterceptor()
|
||||
object.metaClass.static.invokeMethod = helper.getMethodInterceptor()
|
||||
object.metaClass.methodMissing = helper.getMethodMissingInterceptor()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,10 +39,7 @@ class MtaUtilsTest extends BasePiperTest {
|
||||
@Before
|
||||
void init() {
|
||||
targetMtaDescriptor = "${tmp.getRoot()}/generated_mta.yml"
|
||||
def script = new Object()
|
||||
mtaUtils = new MtaUtils(script)
|
||||
|
||||
prepareObjectInterceptors(script)
|
||||
mtaUtils = new MtaUtils(nullScript)
|
||||
|
||||
this.helper.registerAllowedMethod('readJSON', [Map], { Map parameters ->
|
||||
return new JsonSlurper().parse(new File(parameters.file))
|
||||
|
@ -40,13 +40,11 @@ class DockerArtifactVersioningTest extends BasePiperTest{
|
||||
passedDir = s
|
||||
return closure()
|
||||
})
|
||||
|
||||
prepareObjectInterceptors(this)
|
||||
}
|
||||
|
||||
@Test
|
||||
void testVersioningFrom() {
|
||||
av = new DockerArtifactVersioning(this, [filePath: 'Dockerfile', dockerVersionSource: 'FROM'])
|
||||
av = new DockerArtifactVersioning(nullScript, [filePath: 'Dockerfile', dockerVersionSource: 'FROM'])
|
||||
assertEquals('1.2.3', av.getVersion())
|
||||
av.setVersion('1.2.3-20180101')
|
||||
assertEquals('1.2.3-20180101', jwfr.files['VERSION'])
|
||||
@ -55,15 +53,8 @@ class DockerArtifactVersioningTest extends BasePiperTest{
|
||||
|
||||
@Test
|
||||
void testVersioningEnv() {
|
||||
av = new DockerArtifactVersioning(this, [filePath: 'Dockerfile', dockerVersionSource: 'TEST'])
|
||||
av = new DockerArtifactVersioning(nullScript, [filePath: 'Dockerfile', dockerVersionSource: 'TEST'])
|
||||
assertEquals('2.3.4', av.getVersion())
|
||||
assertTrue(jlr.log.contains('[DockerArtifactVersioning] Version from Docker environment variable TEST: 2.3.4'))
|
||||
}
|
||||
|
||||
|
||||
void prepareObjectInterceptors(object) {
|
||||
object.metaClass.invokeMethod = helper.getMethodInterceptor()
|
||||
object.metaClass.static.invokeMethod = helper.getMethodInterceptor()
|
||||
object.metaClass.methodMissing = helper.getMethodMissingInterceptor()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user