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

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

commit cf032e9a2026dad52b185f99f0c35756ef13f492
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Sat Jan 24 18:43:20 2026 +0000

    CAMEL-21196: modernize exception-based assertions in camel-olingo4
---
 .../apache/camel/component/olingo4/Olingo4AppAPITest.java   | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git 
a/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
 
b/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
index 5a7b0ed39bcc..b08d317fb3fb 100644
--- 
a/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
+++ 
b/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
@@ -80,6 +80,7 @@ import org.slf4j.LoggerFactory;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 
@@ -481,17 +482,15 @@ public class Olingo4AppAPITest {
         HttpStatusCode statusCode = statusHandler.await();
         LOG.info("Deletion of Entity was successful:  {}: {}", 
statusCode.getStatusCode(), statusCode.getInfo());
 
-        try {
-            LOG.info("Verify Delete Entity");
+        LOG.info("Verify Delete Entity");
 
-            entryHandler.reset();
-            olingoApp.read(edm, TEST_CREATE_PEOPLE, null, null, entryHandler);
+        entryHandler.reset();
+        olingoApp.read(edm, TEST_CREATE_PEOPLE, null, null, entryHandler);
 
+        assertThrows(Exception.class, () -> {
             entryHandler.await();
             fail("Entity not deleted!");
-        } catch (Exception e) {
-            LOG.info("Deleted entity not found: {}", e.getMessage());
-        }
+        });
     }
 
     @Test

Reply via email to