Adding key timestamp to integration test environments.
diff --git a/src/main/java/io/mifos/core/test/servicestarter/IntegrationTestEnvironment.java b/src/main/java/io/mifos/core/test/servicestarter/IntegrationTestEnvironment.java
index 685f01c..a9a7bb9 100644
--- a/src/main/java/io/mifos/core/test/servicestarter/IntegrationTestEnvironment.java
+++ b/src/main/java/io/mifos/core/test/servicestarter/IntegrationTestEnvironment.java
@@ -83,10 +83,11 @@
properties.setProperty(HYSTRIX_ENABLED_PROPERTY, HYSTRIX_ENABLED_DEFAULT);
properties.setProperty(RIBBON_USES_EUREKA_PROPERTY, RIBBON_USES_EUREKA_DEFAULT);
this.keyPairHolder = RsaKeyPairFactory.createKeyPair();
+ properties.setProperty(SYSTEM_PUBLIC_KEY_TIMESTAMP_PROPERTY, this.keyPairHolder.getTimestamp());
properties.setProperty(SYSTEM_PUBLIC_KEY_MODULUS_PROPERTY, this.keyPairHolder.publicKey().getModulus().toString());
properties.setProperty(SYSTEM_PUBLIC_KEY_EXPONENT_PROPERTY, this.keyPairHolder.publicKey().getPublicExponent().toString());
- this.systemSecurityEnvironment = new SystemSecurityEnvironment(keyPairHolder.publicKey(), keyPairHolder.privateKey());
+ this.systemSecurityEnvironment = new SystemSecurityEnvironment(keyPairHolder.getTimestamp(), keyPairHolder.publicKey(), keyPairHolder.privateKey());
this.dataStoreTenantInitializers = dataStoreTenantInitializers;
nextPort = 2020;
@@ -132,6 +133,10 @@
}
}
+ public String getSeshatKeyTimestamp() {
+ return this.keyPairHolder.getTimestamp();
+ }
+
public RSAPublicKey getSeshatPublicKey() {
return this.keyPairHolder.publicKey();
}
diff --git a/src/main/java/io/mifos/core/test/servicestarter/Microservice.java b/src/main/java/io/mifos/core/test/servicestarter/Microservice.java
index 58c5065..12dbb56 100644
--- a/src/main/java/io/mifos/core/test/servicestarter/Microservice.java
+++ b/src/main/java/io/mifos/core/test/servicestarter/Microservice.java
@@ -55,7 +55,7 @@
applicationName = AnnotatedElementUtils.getMergedAnnotationAttributes(clazz, FeignClient.class).getString("value");
this.processEnvironment = new TestEnvironment(applicationName);
processEnvironment.setProperty(TestEnvironment.SERVER_PORT_PROPERTY, integrationTestEnvironment.getFreshPort().toString());
- processEnvironment.setKeyPair(integrationTestEnvironment.getSeshatPublicKey(), integrationTestEnvironment.getSeshatPrivateKey());
+ processEnvironment.setKeyPair(integrationTestEnvironment.getSeshatKeyTimestamp(), integrationTestEnvironment.getSeshatPublicKey(), integrationTestEnvironment.getSeshatPrivateKey());
//https://github.com/spring-cloud/spring-cloud-netflix/issues/373
//http://blog.abhijitsarkar.org/technical/netflix-eureka/