This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 558463a51 chore: Groovy checks inside repeatOnError throw 
CitrusRuntimeException, so Citrus retries them (#3347)
558463a51 is described below

commit 558463a517ce240eda1213a00b3d1486f5f4657a
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Nov 22 10:44:11 2026 +0100

    chore: Groovy checks inside repeatOnError throw CitrusRuntimeException, so 
Citrus retries them (#3347)
    
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../src/test/resources/aws/firehose/verifyDelivery.groovy         | 4 +++-
 .../src/test/resources/ceph/verifyObject.groovy                   | 8 ++++++--
 .../src/test/resources/ftp/verifyUpload.groovy                    | 4 ++--
 .../src/test/resources/smpp/smppsim-verify-submit.groovy          | 2 +-
 .../src/test/resources/ssh/verifyUpload.groovy                    | 6 +++---
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git 
a/tests/camel-kamelets-itest/src/test/resources/aws/firehose/verifyDelivery.groovy
 
b/tests/camel-kamelets-itest/src/test/resources/aws/firehose/verifyDelivery.groovy
index 8efe606aa..819f781ba 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/aws/firehose/verifyDelivery.groovy
+++ 
b/tests/camel-kamelets-itest/src/test/resources/aws/firehose/verifyDelivery.groovy
@@ -28,4 +28,6 @@ if (objects.size() != 1) {
 
 String content = s3.getObjectAsBytes(b -> 
b.bucket('firehose-bucket').key(objects[0].key())).asUtf8String()
 // Floci ends each record that it writes with a line break; Amazon Data 
Firehose writes the record as it is
-assert content == 'order ORD-1\n' : "Unexpected file content '" + content + "'"
+if (!(content == 'order ORD-1\n')) {
+    throw new 
org.citrusframework.exceptions.CitrusRuntimeException("Unexpected file content 
'" + content + "'")
+}
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/ceph/verifyObject.groovy 
b/tests/camel-kamelets-itest/src/test/resources/ceph/verifyObject.groovy
index dfdf21eff..1f0604ea8 100644
--- a/tests/camel-kamelets-itest/src/test/resources/ceph/verifyObject.groovy
+++ b/tests/camel-kamelets-itest/src/test/resources/ceph/verifyObject.groovy
@@ -30,10 +30,14 @@ def response = 
s3.getObjectAsBytes(GetObjectRequest.builder()
 
 String content = response.asUtf8String()
 String expected = context.getVariable('s3.content')
-assert content == expected : "Expected '" + expected + "' but got '" + content 
+ "'"
+if (!(content == expected)) {
+    throw new org.citrusframework.exceptions.CitrusRuntimeException("Expected 
'" + expected + "' but got '" + content + "'")
+}
 
 if (context.getVariables().containsKey('s3.contentType')) {
     String contentType = response.response().contentType()
     String expectedType = context.getVariable('s3.contentType')
-    assert contentType == expectedType : "Expected content type '" + 
expectedType + "' but got '" + contentType + "'"
+    if (!(contentType == expectedType)) {
+        throw new 
org.citrusframework.exceptions.CitrusRuntimeException("Expected content type '" 
+ expectedType + "' but got '" + contentType + "'")
+    }
 }
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/ftp/verifyUpload.groovy 
b/tests/camel-kamelets-itest/src/test/resources/ftp/verifyUpload.groovy
index 2dc6bcd43..670e5e6b9 100644
--- a/tests/camel-kamelets-itest/src/test/resources/ftp/verifyUpload.groovy
+++ b/tests/camel-kamelets-itest/src/test/resources/ftp/verifyUpload.groovy
@@ -23,9 +23,9 @@ import java.nio.file.Paths
 
 def file = Paths.get(context.getVariable('ftp.home'), 'upload', 'day 1.csv')
 if (!Files.exists(file)) {
-    throw new AssertionError('The FTP server has no file ' + file)
+    throw new org.citrusframework.exceptions.CitrusRuntimeException('The FTP 
server has no file ' + file)
 }
 def content = Files.readString(file)
 if (content != 'id,item\n1,book') {
-    throw new AssertionError('Unexpected content of ' + file + ': ' + 
content.inspect())
+    throw new 
org.citrusframework.exceptions.CitrusRuntimeException('Unexpected content of ' 
+ file + ': ' + content.inspect())
 }
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/smpp/smppsim-verify-submit.groovy
 
b/tests/camel-kamelets-itest/src/test/resources/smpp/smppsim-verify-submit.groovy
index 55f3de305..73921125b 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/smpp/smppsim-verify-submit.groovy
+++ 
b/tests/camel-kamelets-itest/src/test/resources/smpp/smppsim-verify-submit.groovy
@@ -22,6 +22,6 @@ def smppsim = 
context.getReferenceResolver().resolve('smppsim', org.testcontaine
 def logs = smppsim.getLogs()
 ['source_addr=1616', 'dest_addr=4598765432', 'short_message=Your code is 
1234'].each { expected ->
     if (!logs.contains(expected)) {
-        throw new AssertionError('SMPPSim did not log ' + expected + ' for a 
submit_sm')
+        throw new 
org.citrusframework.exceptions.CitrusRuntimeException('SMPPSim did not log ' + 
expected + ' for a submit_sm')
     }
 }
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/ssh/verifyUpload.groovy 
b/tests/camel-kamelets-itest/src/test/resources/ssh/verifyUpload.groovy
index 67a372c9a..457a95c18 100644
--- a/tests/camel-kamelets-itest/src/test/resources/ssh/verifyUpload.groovy
+++ b/tests/camel-kamelets-itest/src/test/resources/ssh/verifyUpload.groovy
@@ -25,13 +25,13 @@ def file = '/config/upload/day 1.csv'
 
 def content = ssh.execInContainer('cat', file)
 if (content.getExitCode() != 0) {
-    throw new AssertionError('The server has no file ' + file + ': ' + 
content.getStderr())
+    throw new org.citrusframework.exceptions.CitrusRuntimeException('The 
server has no file ' + file + ': ' + content.getStderr())
 }
 if (content.getStdout() != 'id,item\n1,book') {
-    throw new AssertionError('Unexpected content of ' + file + ': ' + 
content.getStdout().inspect())
+    throw new 
org.citrusframework.exceptions.CitrusRuntimeException('Unexpected content of ' 
+ file + ': ' + content.getStdout().inspect())
 }
 def stat = ssh.execInContainer('stat', '-c', '%a %U', file).getStdout().trim()
 def expected = context.getVariable('ssh.chmod') + ' citrus'
 if (stat != expected) {
-    throw new AssertionError('Expected the permissions and owner ' + expected 
+ ' of ' + file + ' but got ' + stat)
+    throw new org.citrusframework.exceptions.CitrusRuntimeException('Expected 
the permissions and owner ' + expected + ' of ' + file + ' but got ' + stat)
 }

Reply via email to