From 9c544bb6e07708cb7fc3ddcbe776eb0b7f768292 Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Wed, 21 Feb 2018 12:46:55 +0100 Subject: [PATCH] Make test more tolerant --- test/groovy/MTABuildTest.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/groovy/MTABuildTest.groovy b/test/groovy/MTABuildTest.groovy index 42d2c704d..ab37ce21a 100644 --- a/test/groovy/MTABuildTest.groovy +++ b/test/groovy/MTABuildTest.groovy @@ -67,7 +67,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[1].contains('PATH=./node_modules/.bin:/usr/bin') + assert jscr.shell.find { c -> c.contains('PATH=./node_modules/.bin:/usr/bin')} } @@ -76,7 +76,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/ + assert jscr.shell.find { c -> c =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/mta.yaml"$/} } @@ -99,7 +99,7 @@ public class MtaBuildTest extends BasePipelineTest { def mtarFilePath = jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[0] =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/newDir\/mta.yaml"$/ + assert jscr.shell.find { c -> c =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" ".*\/newDir\/mta.yaml"$/} assert mtarFilePath == "$newDir/com.mycompany.northwind.mtar" } @@ -110,7 +110,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[1].contains(' -jar mta.jar --mtar ') + assert jscr.shell.find { c -> c.contains(' -jar mta.jar --mtar ')} assert jlr.log.contains('[mtaBuild] Using MTA JAR from current working directory.') } @@ -121,7 +121,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(mtaJarLocation: '/mylocation/mta', buildTarget: 'NEO') - assert jscr.shell[1].contains(' -jar /mylocation/mta/mta.jar --mtar ') + assert jscr.shell.find { c -> c.contains(' -jar /mylocation/mta/mta.jar --mtar ')} assert jlr.log.contains('[mtaBuild] MTA JAR "/mylocation/mta/mta.jar" retrieved from configuration.') } @@ -169,7 +169,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[1].contains('-jar /env/mta/mta.jar --mtar') + assert jscr.shell.find { c -> c.contains('-jar /env/mta/mta.jar --mtar')} assert jlr.log.contains('[mtaBuild] MTA JAR "/env/mta/mta.jar" retrieved from environment.') } @@ -182,7 +182,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(script: [commonPipelineEnvironment: jer.env], buildTarget: 'NEO') - assert jscr.shell[1].contains('-jar /step/mta/mta.jar --mtar') + assert jscr.shell.find(){ c -> c.contains('-jar /step/mta/mta.jar --mtar')} assert jlr.log.contains('[mtaBuild] MTA JAR "/step/mta/mta.jar" retrieved from configuration.') } @@ -192,7 +192,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(buildTarget: 'NEO') - assert jscr.shell[1].contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build') + assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} } @@ -203,7 +203,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(script: [commonPipelineEnvironment: jer.env]) - assert jscr.shell[1].contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build') + assert jscr.shell.find(){ c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} } @@ -214,7 +214,7 @@ public class MtaBuildTest extends BasePipelineTest { jsr.step.call(script: [commonPipelineEnvironment: jer.env]) - assert jscr.shell[1].contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build') + assert jscr.shell.find { c -> c.contains('java -jar mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')} }