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.git
commit 6dabafe5aefab4d9186dc81ede84f656d12d5c13 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Oct 14 20:08:15 2021 +0200 Removed bogus test --- .../jcache/policy/JCachePolicyProcessorTest.java | 34 ---------------------- 1 file changed, 34 deletions(-) diff --git a/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/policy/JCachePolicyProcessorTest.java b/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/policy/JCachePolicyProcessorTest.java index a0ebf26..b503414 100644 --- a/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/policy/JCachePolicyProcessorTest.java +++ b/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/policy/JCachePolicyProcessorTest.java @@ -26,12 +26,10 @@ import org.apache.camel.LoggingLevel; import org.apache.camel.RuntimeCamelException; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.language.simple.types.SimpleIllegalSyntaxException; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -208,25 +206,6 @@ public class JCachePolicyProcessorTest extends JCachePolicyTestBase { } - //Use an invalid key expression causing an exception - @Test - public void testInvalidKeyExpression() throws Exception { - final String body = randomString(); - MockEndpoint mock = getMockEndpoint("mock:value"); - Cache cache = lookupCache("simple"); - - //Send - Exchange response = this.template().request("direct:cached-invalidkey", - e -> e.getMessage().setBody(body)); - - //Exception is on the exchange, cache is empty, onException was called. - assertIsInstanceOf(SimpleIllegalSyntaxException.class, response.getException()); - assertEquals("exception-" + body, response.getMessage().getBody()); - assertEquals(0, mock.getExchanges().size()); - assertFalse(cache.iterator().hasNext()); - - } - //Value is cached after handled exception @Test public void testHandledException() throws Exception { @@ -320,19 +299,6 @@ public class JCachePolicyProcessorTest extends JCachePolicyTestBase { from("direct:cached-byheader") .policy(jcachePolicy) .to("mock:value"); - - //Use an invalid keyExpression - jcachePolicy = new JCachePolicy(); - jcachePolicy.setCache(cacheManager.getCache("simple")); - jcachePolicy.setKeyExpression(simple("${unexpected}")); - - from("direct:cached-invalidkey") - .onException(Exception.class) - .setBody(simple("exception-${body}")) - .end() - - .policy(jcachePolicy) - .to("mock:value"); } }; }