Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,22 @@ abstract class BasePipelineTest {

ClassLoader baseClassLoader = this.class.classLoader

def stringInterceptor = { m -> m.variable }
def paramInterceptor = { Map desc ->
addParam(desc.name, desc.defaultValue, false)
}

def stringInterceptor = { Map desc->
if (desc) {
// we are in context of parameters { string(...)}
if (desc.name) {
addParam(desc.name, desc.defaultValue, false)
}
// we are in context of withCredentials([string()..]) { }
if(desc.variable) {
return desc.variable
}
}
}

def usernamePasswordInterceptor = { m -> [m.usernameVariable, m.passwordVariable] }

Expand Down Expand Up @@ -131,6 +146,7 @@ abstract class BasePipelineTest {
getProjectName:{"some_job"},
]
})
helper.registerAllowedMethod('booleanParam', [Map], paramInterceptor)
helper.registerAllowedMethod("buildDiscarder", [Object])
helper.registerAllowedMethod("checkout", [Map])
helper.registerAllowedMethod("choice", [Map])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@ abstract class DeclarativePipelineTest extends BasePipelineTest {
GenericPipelineDeclaration.createComponent(DeclarativePipeline, closure).execute(delegate)
}

def paramInterceptor = { Map desc ->
addParam(desc.name, desc.defaultValue, false)
}

def stringInterceptor = { Map desc->
if (desc) {
// we are in context of parameters { string(...)}
if (desc.name) {
addParam(desc.name, desc.defaultValue, false)
}
// we are in context of withCredentials([string()..]) { }
if(desc.variable) {
return desc.variable
}
}
}

@Override
void setUp() throws Exception {
super.setUp()
Expand Down