parent
cd1d223deb
commit
c944ee3074
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
|
@ -98,7 +98,7 @@ public class CloudFoundryVcapEnvironmentPostProcessor implements EnvironmentPost
|
|||
private final Log logger;
|
||||
|
||||
// Before ConfigDataEnvironmentPostProcessor so values there can use these
|
||||
private int order = ConfigDataEnvironmentPostProcessor.ORDER - 1;
|
||||
private int order = ConfigDataEnvironmentPostProcessor.ORDER - 5;
|
||||
|
||||
/**
|
||||
* Create a new {@link CloudFoundryVcapEnvironmentPostProcessor} instance.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
|
@ -21,6 +21,7 @@ import java.util.function.Supplier;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor;
|
||||
import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.test.context.support.TestPropertySourceUtils;
|
||||
|
@ -32,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
*
|
||||
* @author Dave Syer
|
||||
* @author Andy Wilkinson
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
class CloudFoundryVcapEnvironmentPostProcessorTests {
|
||||
|
||||
|
@ -119,6 +121,12 @@ class CloudFoundryVcapEnvironmentPostProcessorTests {
|
|||
assertThat(getProperty("vcap.services.mysql.credentials.port")).isEqualTo("3306");
|
||||
}
|
||||
|
||||
@Test
|
||||
void orderShouldBeBeforeConfigDataEnvironmentPostProcessorWithGap() {
|
||||
assertThat(this.initializer.getOrder()).isLessThan(ConfigDataEnvironmentPostProcessor.ORDER);
|
||||
assertThat(this.initializer.getOrder()).isLessThan(ConfigDataEnvironmentPostProcessor.ORDER - 1);
|
||||
}
|
||||
|
||||
private String getProperty(String key) {
|
||||
return this.context.getEnvironment().getProperty(key);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue