![JAR search and dependency download from the Maven repository](/logo.png)
io.zonky.test.db.flyway.FlywayPropertiesPostProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of embedded-database-spring-test Show documentation
Show all versions of embedded-database-spring-test Show documentation
A library for creating isolated embedded databases for Spring-powered integration tests.
The newest version!
package io.zonky.test.db.flyway;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.flyway.FlywayProperties;
import org.springframework.core.Ordered;
public class FlywayPropertiesPostProcessor implements BeanPostProcessor, Ordered {
@Override
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE - 1;
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof FlywayProperties) {
FlywayProperties properties = (FlywayProperties) bean;
properties.setUrl(null);
properties.setUser(null);
properties.setPassword(null);
}
return bean;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy