Skip to content

Commit 7e1a106

Browse files
committed
Merge branch 'hotfix/0.8.11'
2 parents 5f0fa2d + 218af77 commit 7e1a106

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
<groupId>eu.openanalytics</groupId>
77
<artifactId>containerproxy</artifactId>
8-
<version>0.8.10</version>
8+
<version>0.8.11</version>
99
<name>ContainerProxy</name>
1010
<packaging>jar</packaging>
1111

1212
<parent>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-starter-parent</artifactId>
15-
<version>2.3.12.RELEASE</version>
15+
<version>2.5.12</version>
1616
<relativePath />
1717
</parent>
1818

@@ -132,7 +132,7 @@
132132
<dependency>
133133
<groupId>org.springframework.security.oauth.boot</groupId>
134134
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
135-
<version>2.3.12.RELEASE</version>
135+
<version>2.5.12</version>
136136
</dependency>
137137
<dependency>
138138
<groupId>org.springframework.security</groupId>

src/main/java/eu/openanalytics/containerproxy/ContainerProxyApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ public static Properties getDefaultProperties() {
282282

283283
// ====================
284284

285+
properties.put("spring.config.use-legacy-processing", true);
286+
285287
return properties;
286288
}
287289

src/main/java/eu/openanalytics/containerproxy/ui/ErrorController.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ public ResponseEntity<Map<String, Object>> error(HttpServletRequest request, Htt
106106
return new ResponseEntity<>(map, HttpStatus.valueOf(response.getStatus()));
107107
}
108108

109-
@Override
110-
public String getErrorPath() {
111-
return "/error";
112-
}
113-
114109
private String[] createMsgStack(Throwable exception) {
115110
String message = "";
116111
String stackTrace = "";

src/test/java/eu/openanalytics/containerproxy/test/proxy/PropertyOverrideContextInitializer.java

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,34 @@
2323
import eu.openanalytics.containerproxy.ContainerProxyApplication;
2424
import org.springframework.context.ApplicationContextInitializer;
2525
import org.springframework.context.ConfigurableApplicationContext;
26+
import org.springframework.core.env.MutablePropertySources;
2627
import org.springframework.core.env.PropertiesPropertySource;
28+
import org.springframework.core.env.PropertySource;
2729
import org.springframework.test.context.support.TestPropertySourceUtils;
2830

31+
import javax.annotation.Nonnull;
32+
import java.util.stream.Collectors;
33+
2934
public class PropertyOverrideContextInitializer
30-
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
35+
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
36+
37+
@Override
38+
public void initialize(@Nonnull ConfigurableApplicationContext configurableApplicationContext) {
39+
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(configurableApplicationContext,
40+
"proxy.kubernetes.namespace=" + TestIntegrationOnKube.namespace);
3141

32-
@Override
33-
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
34-
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(configurableApplicationContext,
35-
"proxy.kubernetes.namespace=" + TestIntegrationOnKube.namespace);
42+
MutablePropertySources propertySources = configurableApplicationContext.getEnvironment().getPropertySources();
43+
PropertiesPropertySource defaultProperties = new PropertiesPropertySource("shinyProxyDefaultProperties", ContainerProxyApplication.getDefaultProperties());
44+
propertySources.addFirst(defaultProperties);
3645

37-
PropertiesPropertySource defaultProperties = new PropertiesPropertySource("shinyProxyDefaultProperties", ContainerProxyApplication.getDefaultProperties());
38-
configurableApplicationContext.getEnvironment().getPropertySources().addFirst(defaultProperties);
46+
// remove any external, file-based property source
47+
// we don't want any application.yml or application.properties to be loaded during the tests
48+
propertySources
49+
.stream()
50+
.map(PropertySource::getName)
51+
.filter(p -> p.contains("Config resource 'file ") && p.contains("via location 'optional:file:./'"))
52+
.collect(Collectors.toList())
53+
.forEach(propertySources::remove);
3954

40-
}
55+
}
4156
}

0 commit comments

Comments
 (0)