You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/15 07:16:13 UTC

[camel] 02/02: Camel-AWS2-IAM: Adding more tests with localstack and Testcontainers

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5bb1e4abb4720b4f4e12ef1d30c6851dbd32e8c8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 15 09:15:41 2020 +0200

    Camel-AWS2-IAM: Adding more tests with localstack and Testcontainers
---
 .../java/org/apache/camel/component/aws2/iam/IAM2Producer.java    | 2 +-
 .../aws2/iam/localstack/IAMListAccessKeyLocalstackTest.java       | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/components/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Producer.java b/components/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Producer.java
index 80dbe7f..9171065 100644
--- a/components/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Producer.java
+++ b/components/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Producer.java
@@ -156,7 +156,7 @@ public class IAM2Producer extends DefaultProducer {
         } else {
             ListAccessKeysResponse response;
             try {
-                response = iamClient.listAccessKeys();
+                response = iamClient.listAccessKeys(ListAccessKeysRequest.builder().build());
             } catch (AwsServiceException ase) {
                 LOG.trace("List Access Keys command returned the error code {}", ase.getMessage());
                 throw ase;
diff --git a/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/localstack/IAMListAccessKeyLocalstackTest.java b/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/localstack/IAMListAccessKeyLocalstackTest.java
index 3b7f13a..3a30b7e 100644
--- a/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/localstack/IAMListAccessKeyLocalstackTest.java
+++ b/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/localstack/IAMListAccessKeyLocalstackTest.java
@@ -24,13 +24,8 @@ import org.apache.camel.component.aws2.iam.IAM2Constants;
 import org.apache.camel.component.aws2.iam.IAM2Operations;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
-
-import software.amazon.awssdk.services.iam.model.CreateUserRequest;
-import software.amazon.awssdk.services.iam.model.CreateUserResponse;
 import software.amazon.awssdk.services.iam.model.ListAccessKeysRequest;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
 public class IAMListAccessKeyLocalstackTest extends Aws2IAMBaseTest {
 
     @EndpointInject("mock:result")
@@ -73,8 +68,7 @@ public class IAMListAccessKeyLocalstackTest extends Aws2IAMBaseTest {
                 from("direct:createUser").to("aws2-iam://test?operation=createUser");
                 from("direct:createAccessKey").to("aws2-iam://test?operation=createAccessKey");
                 from("direct:listKeys").to("aws2-iam://test?operation=listAccessKeys&pojoRequest=true")
-                         .to("mock:result");
-
+                        .to("mock:result");
 
             }
         };