You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "JiriOndrusek (via GitHub)" <gi...@apache.org> on 2023/04/26 08:48:15 UTC
[GitHub] [camel-quarkus] JiriOndrusek commented on a diff in pull request #4828: MinIO: Extend test coverage #4707
JiriOndrusek commented on code in PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#discussion_r1177552028
##########
integration-tests/minio/src/main/java/org/apache/camel/quarkus/component/minio/it/MinioResource.java:
##########
@@ -30,76 +34,169 @@
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import org.apache.camel.CamelContext;
import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.Exchange;
import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.minio.MinioComponent;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
+import org.apache.camel.util.Pair;
@Path("/minio")
@ApplicationScoped
public class MinioResource {
public static final String SERVER_ACCESS_KEY = "testAccessKey";
public static final String SERVER_SECRET_KEY = "testSecretKey";
+ private static final String URL_AUTH = "accessKey=" + SERVER_ACCESS_KEY + "&secretKey=RAW(" + SERVER_SECRET_KEY + ")";
@Inject
ProducerTemplate producerTemplate;
@Inject
ConsumerTemplate consumerTemplate;
+ @Inject
+ CamelContext camelContext;
+
+ @Path("/consumerWithClientCreation/{endpoint}")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response consumerWithClientCreation(@PathParam("endpoint") String endpoint) {
+ MinioComponent minioComponent = camelContext.getComponent("minio", MinioComponent.class);
+ MinioClient client = minioComponent.getConfiguration().getMinioClient();
+ minioComponent.getConfiguration().setMinioClient(null);
Review Comment:
you are right, that would be "cleaner" solution, thanks for the hint, I'll change that
--
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