secretProperties = vaultClient.read(forAws(aws),
+ Settings.token());
+
+ assertThat(secretProperties).containsKeys("cloud.aws.credentials.accessKey",
+ "cloud.aws.credentials.secretKey");
+ }
+
+}
diff --git a/spring-cloud-vault-config-aws/src/test/java/org/springframework/cloud/vault/config/aws/VaultConfigAwsTests.java b/spring-cloud-vault-config-aws/src/test/java/org/springframework/cloud/vault/config/aws/VaultConfigAwsTests.java
new file mode 100644
index 00000000..b1e425c4
--- /dev/null
+++ b/spring-cloud-vault-config-aws/src/test/java/org/springframework/cloud/vault/config/aws/VaultConfigAwsTests.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2016 the original author or authors.
+ *
+ * Licensed 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.springframework.cloud.vault.config.aws;
+
+import static org.assertj.core.api.Assertions.*;
+import static org.junit.Assume.*;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.test.IntegrationTest;
+import org.springframework.boot.test.SpringApplicationConfiguration;
+import org.springframework.cloud.vault.util.VaultRule;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.util.StringUtils;
+
+/**
+ * Integration tests using the aws secret backend. In case this test should fail because
+ * of SSL make sure you run the test within the
+ * spring-cloud-vault-config/spring-cloud-vault-config directory as the keystore is
+ * referenced with {@code ../work/keystore.jks}.
+ *
+ * This test requires AWS credentials and a region, see {@link #AWS_ACCESS_KEY},
+ * {@link #AWS_SECRET_KEY} and the {@link IntegrationTest} properties to be provided
+ * externally.
+ *
+ * @author Mark Paluch
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringApplicationConfiguration(classes = VaultConfigAwsTests.TestApplication.class)
+@IntegrationTest({ "spring.cloud.vault.aws.enabled=true",
+ "spring.cloud.vault.aws.role=readonly", "cloud.aws.region.auto=false",
+ "cloud.aws.region.static=eu-west-1" })
+public class VaultConfigAwsTests {
+
+ private final static String AWS_REGION = "eu-west-1";
+ private final static String AWS_ACCESS_KEY = System.getProperty("aws.access.key");
+ private final static String AWS_SECRET_KEY = System.getProperty("aws.secret.key");
+
+ private final static String ARN = "arn:aws:iam::aws:policy/ReadOnlyAccess";
+
+ /**
+ * Initialize the aws secret backend.
+ *
+ * @throws Exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+
+ assumeTrue(StringUtils.hasText(AWS_ACCESS_KEY)
+ && StringUtils.hasText(AWS_SECRET_KEY));
+
+ VaultRule vaultRule = new VaultRule();
+ vaultRule.before();
+
+ if (!vaultRule.prepare().hasSecret("aws")) {
+ vaultRule.prepare().mountSecret("aws");
+ }
+
+ Map connection = new HashMap<>();
+ connection.put("region", AWS_REGION);
+ connection.put("access_key", AWS_ACCESS_KEY);
+ connection.put("secret_key", AWS_SECRET_KEY);
+
+ vaultRule.prepare().write("aws/config/root", connection);
+
+ vaultRule.prepare().write("aws/roles/readonly",
+ Collections.singletonMap("arn", ARN));
+ }
+
+ @Value("${cloud.aws.credentials.accessKey}")
+ String accessKey;
+
+ @Value("${cloud.aws.credentials.secretKey}")
+ String secretKey;
+
+ @Test
+ public void shouldInitializeAwsProperties() throws Exception {
+
+ assertThat(accessKey).isNotEmpty();
+ assertThat(secretKey).isNotEmpty();
+ }
+
+ @SpringBootApplication
+ public static class TestApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(TestApplication.class, args);
+ }
+ }
+}
diff --git a/spring-cloud-vault-config-aws/src/test/resources/bootstrap.yml b/spring-cloud-vault-config-aws/src/test/resources/bootstrap.yml
new file mode 100644
index 00000000..c598d962
--- /dev/null
+++ b/spring-cloud-vault-config-aws/src/test/resources/bootstrap.yml
@@ -0,0 +1,5 @@
+spring:
+ application.name: testVaultApp
+ cloud.vault.token: 00000000-0000-0000-0000-000000000000
+ cloud.vault.ssl.trust-store: file:../work/keystore.jks
+ cloud.vault.ssl.trust-store-password: changeit