You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/10/06 10:41:51 UTC

[GitHub] [camel-quarkus] jamesnetherton commented on a diff in pull request #4099: Deprecated parameters in several annotations are ignored - inconsisten

jamesnetherton commented on code in PR #4099:
URL: https://github.com/apache/camel-quarkus/pull/4099#discussion_r988875250


##########
extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainDeprecatedEndpointInjectTest.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.deployment.main;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.direct.DirectEndpoint;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+public class CamelMainDeprecatedEndpointInjectTest {
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest().setExpectedException(IllegalArgumentException.class)
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @EndpointInject(uri = "direct:start")
+    DirectEndpoint start;
+
+    @Test
+    public void camelMainEventBridgeNotConfigured() {

Review Comment:
   See my previous comment about the empty test method.



##########
extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainDeprecatedProduceTest.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.deployment.main;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.FluentProducerTemplate;
+import org.apache.camel.Produce;
+import org.apache.camel.builder.RouteBuilder;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+public class CamelMainDeprecatedProduceTest {
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest().setExpectedException(IllegalArgumentException.class)
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Produce(uri = "direct:start")
+    FluentProducerTemplate produceProducerFluent;
+
+    @Test
+    public void camelMainEventBridgeNotConfigured() {

Review Comment:
   See my previous comment about the empty test method.



##########
extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainDeprecatedConsumeTest.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.deployment.main;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.Consume;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+public class CamelMainDeprecatedConsumeTest {
+    @RegisterExtension
+    static final QuarkusUnitTest CONFIG = new QuarkusUnitTest().setExpectedException(IllegalArgumentException.class)
+            .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
+
+    @Consume(uri = "direct:consumeAnnotation")
+    public String consumeAnnotation(String name) {
+        return "Consumed " + name;
+    }
+
+    @Test
+    public void camelMainEventBridgeNotConfigured() {

Review Comment:
   If the empty test is required to make the tests run, please can we name it something relevant to the thing under test. E.g:
   
   ```
       @Test
       public void consumeAnnotationWithDeprecatedParamsThrowsIllegalArgumentException() {
           // Noop - we expect IllegalArgumentException to be thrown on application startup
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org