You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2021/07/01 13:34:25 UTC

[camel-quarkus] branch main updated: Fix usage of incorrect @Produces annotation

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

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


The following commit(s) were added to refs/heads/main by this push:
     new f6c9389  Fix usage of incorrect @Produces annotation
f6c9389 is described below

commit f6c9389c1de2edbe0e5ee3f9272ba753099156a6
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Jul 1 11:31:23 2021 +0100

    Fix usage of incorrect @Produces annotation
---
 .../digitalocean/it/DigitaloceanRoute.java         |  5 ----
 .../google/storage/it/GoogleStorageResource.java   |  4 ---
 .../component/hazelcast/it/HazelcastRoutes.java    | 35 ----------------------
 .../component/lumberjack/it/LumberjackRoutes.java  |  7 -----
 .../SpringRabbitmqConnectionFactoryProducer.java   |  4 ---
 .../component/twilio/it/TwilioResource.java        |  5 ----
 6 files changed, 60 deletions(-)

diff --git a/integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java b/integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
index 60855db..fc1548b 100644
--- a/integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
+++ b/integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
@@ -20,10 +20,8 @@ import java.util.Optional;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
-import javax.ws.rs.Produces;
 
 import com.myjeeva.digitalocean.impl.DigitalOceanClient;
-import io.quarkus.arc.Unremovable;
 import org.apache.camel.builder.RouteBuilder;
 import org.eclipse.microprofile.config.ConfigProvider;
 import org.eclipse.microprofile.config.inject.ConfigProperty;
@@ -39,9 +37,6 @@ public class DigitaloceanRoute extends RouteBuilder {
      *
      * @return a configured {@link DigitalOceanClient}
      */
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("digitalOceanClient")
     DigitalOceanClient initDigitalOceanClient(MockApiService mockApiService) {
         Optional<String> wireMockUrl = ConfigProvider.getConfig().getOptionalValue("wiremock.url", String.class);
diff --git a/integration-tests/google-storage/src/main/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageResource.java b/integration-tests/google-storage/src/main/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageResource.java
index 90552b3..5f88479 100644
--- a/integration-tests/google-storage/src/main/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageResource.java
+++ b/integration-tests/google-storage/src/main/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageResource.java
@@ -41,7 +41,6 @@ import com.google.cloud.storage.CopyWriter;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 import io.quarkiverse.googlecloudservices.storage.runtime.StorageProducer;
-import io.quarkus.arc.Unremovable;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.ProducerTemplate;
@@ -84,9 +83,6 @@ public class GoogleStorageResource {
 
     private Storage client;
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named(COMPONENT_GOOGLE_STORAGE)
     GoogleCloudStorageComponent produceComponent() throws IOException {
         GoogleCloudStorageComponent gsc = new GoogleCloudStorageComponent();
diff --git a/integration-tests/hazelcast/src/main/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastRoutes.java b/integration-tests/hazelcast/src/main/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastRoutes.java
index 4db4af5..4922407 100644
--- a/integration-tests/hazelcast/src/main/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastRoutes.java
+++ b/integration-tests/hazelcast/src/main/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastRoutes.java
@@ -26,12 +26,10 @@ import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.inject.Named;
 import javax.inject.Singleton;
-import javax.ws.rs.Produces;
 
 import com.hazelcast.collection.ItemEvent;
 import com.hazelcast.core.HazelcastInstance;
 import com.hazelcast.topic.impl.DataAwareMessage;
-import io.quarkus.arc.Unremovable;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
@@ -89,99 +87,66 @@ public class HazelcastRoutes extends RouteBuilder {
     @Named("hazelcastResults")
     Map<String, List<String>> hazelcastResults;
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-instance")
     HazelcastDefaultComponent hazelcastInstance() {
         final HazelcastInstanceComponent hazelcastComponent = new HazelcastInstanceComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-atomicvalue")
     HazelcastDefaultComponent hazelcastAtomicnumber() {
         final HazelcastAtomicnumberComponent hazelcastComponent = new HazelcastAtomicnumberComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-list")
     HazelcastDefaultComponent hazelcastList() {
         final HazelcastListComponent hazelcastComponent = new HazelcastListComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-map")
     HazelcastDefaultComponent hazelcastMap() {
         final HazelcastMapComponent hazelcastComponent = new HazelcastMapComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-multimap")
     HazelcastDefaultComponent hazelcastMultimap() {
         final HazelcastMultimapComponent hazelcastComponent = new HazelcastMultimapComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-replicatedmap")
     HazelcastDefaultComponent hazelcastReplicatedmap() {
         final HazelcastReplicatedmapComponent hazelcastComponent = new HazelcastReplicatedmapComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-set")
     HazelcastDefaultComponent hazelcastSet() {
         final HazelcastSetComponent hazelcastComponent = new HazelcastSetComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-topic")
     HazelcastDefaultComponent hazelcastTopic() {
         final HazelcastTopicComponent hazelcastComponent = new HazelcastTopicComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-queue")
     HazelcastDefaultComponent hazelcastQueue() {
         final HazelcastQueueComponent hazelcastComponent = new HazelcastQueueComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-ringbuffer")
     HazelcastDefaultComponent hazelcastRingbuffer() {
         final HazelcastRingbufferComponent hazelcastComponent = new HazelcastRingbufferComponent();
         return configureHazelcastComponent(hazelcastComponent);
     }
 
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("hazelcast-seda")
     HazelcastDefaultComponent hazelcastSeda() {
         final HazelcastSedaComponent hazelcastComponent = new HazelcastSedaComponent();
diff --git a/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java b/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
index 600f669..902fa52 100644
--- a/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
+++ b/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
@@ -16,11 +16,8 @@
  */
 package org.apache.camel.quarkus.component.lumberjack.it;
 
-import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
-import javax.ws.rs.Produces;
 
-import io.quarkus.arc.Unremovable;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.lumberjack.LumberjackComponent;
 import org.apache.camel.support.jsse.KeyManagersParameters;
@@ -47,9 +44,6 @@ public class LumberjackRoutes extends RouteBuilder {
      *
      * @return a configured {@link LumberjackComponent}
      */
-    @Produces
-    @ApplicationScoped
-    @Unremovable
     @Named("lumberjack-global-ssl")
     LumberjackComponent lumberjackGlobalSsl() throws IllegalAccessException, NoSuchFieldException, InstantiationException {
         final LumberjackComponent lumberjackComponent = new LumberjackComponent();
@@ -59,7 +53,6 @@ public class LumberjackRoutes extends RouteBuilder {
         return lumberjackComponent;
     }
 
-    @Produces
     @Named("ssl")
     SSLContextParameters ssl() {
         return createServerSSLContextParameters();
diff --git a/integration-tests/spring-rabbitmq/src/main/java/org/apache/camel/quarkus/component/spring/rabbitmq/it/SpringRabbitmqConnectionFactoryProducer.java b/integration-tests/spring-rabbitmq/src/main/java/org/apache/camel/quarkus/component/spring/rabbitmq/it/SpringRabbitmqConnectionFactoryProducer.java
index c05468c..b1e0451 100644
--- a/integration-tests/spring-rabbitmq/src/main/java/org/apache/camel/quarkus/component/spring/rabbitmq/it/SpringRabbitmqConnectionFactoryProducer.java
+++ b/integration-tests/spring-rabbitmq/src/main/java/org/apache/camel/quarkus/component/spring/rabbitmq/it/SpringRabbitmqConnectionFactoryProducer.java
@@ -16,9 +16,7 @@
  */
 package org.apache.camel.quarkus.component.spring.rabbitmq.it;
 
-import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
-import javax.ws.rs.Produces;
 
 import org.eclipse.microprofile.config.inject.ConfigProperty;
 import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
@@ -38,8 +36,6 @@ public class SpringRabbitmqConnectionFactoryProducer {
     @ConfigProperty(name = SpringRabbitmqResource.PARAMETER_PASSWORD)
     String password;
 
-    @Produces
-    @ApplicationScoped
     @Named("connectionFactory")
     public ConnectionFactory produceConnectionFactory() {
         CachingConnectionFactory cf = new CachingConnectionFactory();
diff --git a/integration-tests/twilio/src/main/java/org/apache/camel/quarkus/component/twilio/it/TwilioResource.java b/integration-tests/twilio/src/main/java/org/apache/camel/quarkus/component/twilio/it/TwilioResource.java
index 1f2b065..4596886 100644
--- a/integration-tests/twilio/src/main/java/org/apache/camel/quarkus/component/twilio/it/TwilioResource.java
+++ b/integration-tests/twilio/src/main/java/org/apache/camel/quarkus/component/twilio/it/TwilioResource.java
@@ -22,7 +22,6 @@ import java.util.Optional;
 
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.inject.Singleton;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -37,7 +36,6 @@ import com.twilio.http.TwilioRestClient;
 import com.twilio.rest.api.v2010.account.Call;
 import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;
 import com.twilio.rest.api.v2010.account.Message;
-import io.quarkus.arc.Unremovable;
 import org.apache.camel.ProducerTemplate;
 import org.eclipse.microprofile.config.ConfigProvider;
 
@@ -76,9 +74,6 @@ public class TwilioResource {
         return Response.ok(call.getSid()).build();
     }
 
-    @Unremovable
-    @Singleton
-    @Produces
     @Named("restClient")
     public TwilioRestClient restClient() {
         // If mocking is enabled, we need to ensure Twilio API calls are directed to the mock server