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/25 14:05:19 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request, #4828: MinIO: Extend test coverage #4707

JiriOndrusek opened a new pull request, #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828

   fixes https://github.com/apache/camel-quarkus/issues/4707
   
   Last item was not covered fully (`Cover some potentially risky options (risky in the native mode) from CamelMinioContentMD5 , CamelMinioETag, CamelMinioStorageClass, CamelMinioVersionId, CamelMinioCannedAcl`),
   because the code responsible for this feature in Camel component is just very simple setter for MinIO. 
   
   
   <!-- Uncomment and fill this section if your PR is not trivial
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
   -->


-- 
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


[GitHub] [camel-quarkus] jamesnetherton commented on a diff in pull request #4828: MinIO: Extend test coverage #4707

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on code in PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#discussion_r1177397382


##########
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:
   May be better to have a dedicated component instance for this, then you don't need to mess with the original `minio` instance.
   
   E.g
   
   ```
   @Produces
   @Named("minioCamel")
   MinioComponent camelMinioComponent() {
       // Code to set null client, autowired disabled etc
   }
   ```



##########
integration-tests/minio/src/test/java/org/apache/camel/quarkus/component/minio/it/MinioTestResource.java:
##########
@@ -30,6 +30,7 @@ public class MinioTestResource implements QuarkusTestResourceLifecycleManager {
     public static final String CONTAINER_SECRET_KEY = "MINIO_SECRET_KEY";
     private final String CONTAINER_IMAGE = "minio/minio:RELEASE.2020-12-03T05-49-24Z";

Review Comment:
   Might be good to update the container image. Maybe to this:
   
   https://github.com/quarkiverse/quarkus-minio/blob/main/minio-client/deployment/src/main/java/io/quarkiverse/minio/client/deployment/devservices/MinioDevServicesBuildTimeConfig.java#L29



-- 
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


[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #4828: MinIO: Extend test coverage #4707

Posted by "JiriOndrusek (via GitHub)" <gi...@apache.org>.
JiriOndrusek commented on PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#issuecomment-1527061844

   It is good to merge. This PR extends coverage on current version.
   
   Upgrade of minio might not happen because of https://github.com/quarkiverse/quarkus-minio/issues/220


-- 
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


[GitHub] [camel-quarkus] jamesnetherton merged pull request #4828: MinIO: Extend test coverage #4707

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton merged PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828


-- 
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


[GitHub] [camel-quarkus] zbendhiba commented on pull request #4828: MinIO: Extend test coverage #4707

Posted by "zbendhiba (via GitHub)" <gi...@apache.org>.
zbendhiba commented on PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#issuecomment-1522916008

   @JiriOndrusek Since you are working on Minio, maybe you could take a look at test failing while upgrading the dependency. cf https://github.com/apache/camel-quarkus/pull/4831


-- 
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


[GitHub] [camel-quarkus] JiriOndrusek commented on a diff in pull request #4828: MinIO: Extend test coverage #4707

Posted by "JiriOndrusek (via GitHub)" <gi...@apache.org>.
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


[GitHub] [camel-quarkus] JiriOndrusek commented on a diff in pull request #4828: MinIO: Extend test coverage #4707

Posted by "JiriOndrusek (via GitHub)" <gi...@apache.org>.
JiriOndrusek commented on code in PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#discussion_r1177604507


##########
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:
   done



##########
integration-tests/minio/src/test/java/org/apache/camel/quarkus/component/minio/it/MinioTestResource.java:
##########
@@ -30,6 +30,7 @@ public class MinioTestResource implements QuarkusTestResourceLifecycleManager {
     public static final String CONTAINER_SECRET_KEY = "MINIO_SECRET_KEY";
     private final String CONTAINER_IMAGE = "minio/minio:RELEASE.2020-12-03T05-49-24Z";

Review Comment:
   done



-- 
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


[GitHub] [camel-quarkus] jamesnetherton commented on pull request #4828: MinIO: Extend test coverage #4707

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #4828:
URL: https://github.com/apache/camel-quarkus/pull/4828#issuecomment-1527057987

   Is this good to merge? I guess we have to delay the Minio upgrade until the okhttp issue is fixed.


-- 
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