Merge branch 'master' into 2.0.x
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.cloud.config.server.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -81,7 +80,7 @@ public class EncryptionAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass(RsaSecretEncryptor.class)
|
||||
@ConditionalOnProperty(value = "encrypt.key-store.location", matchIfMissing = false)
|
||||
@ConditionalOnProperty(prefix = "encrypt.keyStore", value = "location", matchIfMissing = false)
|
||||
protected static class KeyStoreConfiguration {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class SymmetricEncryptionIntegrationTests {
|
||||
public class EncryptionIntegrationTests {
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
@@ -69,4 +69,23 @@ public class SymmetricEncryptionIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = { ConfigServerApplication.class},
|
||||
properties = "spring.cloud.bootstrap.name:keystore-bootstrap",
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ActiveProfiles({ "test", "native" })
|
||||
@DirtiesContext
|
||||
public static class KeystoreConfigurationIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate testRestTemplate;
|
||||
|
||||
@Test
|
||||
public void keystoreBootstrapConfig() throws Exception {
|
||||
ResponseEntity<String> entity = testRestTemplate
|
||||
.getForEntity("/encrypt/status", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
spring:
|
||||
cloud:
|
||||
config:
|
||||
server:
|
||||
git:
|
||||
uri: file:./target/repos/encrypt-repo
|
||||
bootstrap: true
|
||||
encrypt:
|
||||
key-store:
|
||||
location: classpath:server.jks
|
||||
password: letmein
|
||||
alias: myKey
|
||||
|
||||
Reference in New Issue
Block a user