Skip to content

Commit

Permalink
Merge branch 'hotfix/0.8.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Apr 1, 2022
2 parents 5f0fa2d + 218af77 commit 7e1a106
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<groupId>eu.openanalytics</groupId>
<artifactId>containerproxy</artifactId>
<version>0.8.10</version>
<version>0.8.11</version>
<name>ContainerProxy</name>
<packaging>jar</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<version>2.5.12</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -132,7 +132,7 @@
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.3.12.RELEASE</version>
<version>2.5.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ public static Properties getDefaultProperties() {

// ====================

properties.put("spring.config.use-legacy-processing", true);

return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ public ResponseEntity<Map<String, Object>> error(HttpServletRequest request, Htt
return new ResponseEntity<>(map, HttpStatus.valueOf(response.getStatus()));
}

@Override
public String getErrorPath() {
return "/error";
}

private String[] createMsgStack(Throwable exception) {
String message = "";
String stackTrace = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,34 @@
import eu.openanalytics.containerproxy.ContainerProxyApplication;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.test.context.support.TestPropertySourceUtils;

import javax.annotation.Nonnull;
import java.util.stream.Collectors;

public class PropertyOverrideContextInitializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
implements ApplicationContextInitializer<ConfigurableApplicationContext> {

@Override
public void initialize(@Nonnull ConfigurableApplicationContext configurableApplicationContext) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(configurableApplicationContext,
"proxy.kubernetes.namespace=" + TestIntegrationOnKube.namespace);

@Override
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(configurableApplicationContext,
"proxy.kubernetes.namespace=" + TestIntegrationOnKube.namespace);
MutablePropertySources propertySources = configurableApplicationContext.getEnvironment().getPropertySources();
PropertiesPropertySource defaultProperties = new PropertiesPropertySource("shinyProxyDefaultProperties", ContainerProxyApplication.getDefaultProperties());
propertySources.addFirst(defaultProperties);

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

}
}
}

0 comments on commit 7e1a106

Please sign in to comment.