1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

Adjust test after merging early check for the deployable

In the meantime we check earlier if the deployable exists. Up to now the test used that late check. Now, as that
check happens earlier in the code we have to tune here. Now we assume a failure inside neo deploy instead.
This commit is contained in:
Marcus Holl 2019-04-12 13:10:15 +02:00
parent 28fa30fc8f
commit 862729a703

View File

@ -467,7 +467,7 @@ class NeoDeployTest extends BasePiperTest {
void dontSwallowExceptionWhenUnableToProvideLogsTest() {
thrown.expect(AbortException)
thrown.expectMessage('File archive.mtar cannot be found.')
thrown.expectMessage('Something went wrong during neo deployment')
thrown.expect(new BaseMatcher() {
def expectedException = AbortException
@ -488,7 +488,18 @@ class NeoDeployTest extends BasePiperTest {
loggingRule.expect('Unable to provide the logs.')
helper.registerAllowedMethod('fileExists', [String], { false })
helper.registerAllowedMethod('fileExists', [String],
{ f ->
f == 'archive.mtar'
}
)
helper.registerAllowedMethod('sh', [Map],
{ m ->
if(m.script.toString().contains('neo.sh deploy-mta'))
throw new AbortException('Something went wrong during neo deployment.')
}
)
helper.registerAllowedMethod("sh", [String],
{ cmd ->
if (cmd == 'cat logs/neo/*')