Skip to content

Commit

Permalink
GH-417 - Remove obsolete EnvironmentPostProcessor.
Browse files Browse the repository at this point in the history
We switched to a different way of declaring default properties in 5ef57b2.
  • Loading branch information
odrotbohm committed Dec 2, 2022
1 parent f043fcf commit 631f0a2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
33 changes: 0 additions & 33 deletions src/main/java/org/salespointframework/Salespoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@
*/
package org.salespointframework;

import java.util.HashMap;

import org.salespointframework.inventory.LineItemFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

Expand Down Expand Up @@ -61,31 +55,4 @@ public BCryptPasswordEncoder passwordEncoder() {
public LineItemFilter inventoryLineItemFilter() {
return LineItemFilter.handleAll();
}

/**
* Needed until https://github.com/spring-projects/spring-boot/issues/12194 and
* https://github.com/spring-projects/spring-boot/issues/16747 are fixed.
*
* @author Oliver Gierke
*/
static class RequiredPropertiesPostProcessor implements EnvironmentPostProcessor {

/*
* (non-Javadoc)
* @see org.springframework.boot.env.EnvironmentPostProcessor#postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment, org.springframework.boot.SpringApplication)
*/
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {

var sources = environment.getPropertySources();

var properties = new HashMap<String, Object>();
properties.put("spring.aop.proxy-target-class", false);
properties.put("spring.datasource.generate-unique-name", true);
properties.put("spring.jpa.open-in-view", true);
properties.put("spring.jpa.properties.hibernate.auto_quote_keyword", true);

sources.addFirst(new MapPropertySource("salespointDefaults", properties));
}
}
}
1 change: 0 additions & 1 deletion src/main/resources/META-INF/spring.factories

This file was deleted.

0 comments on commit 631f0a2

Please sign in to comment.