Spring Projects Issues
Spring Projects Issues
**[Martin Flower](https://jira.spring.io/secure/ViewProfile.jspa?name=sylvestris)** commented Thanks Sam. At the moment I have the following abstract base classes ```java @ContextConfiguration(locations = {"/test-context.xml", "/test-db-context.xml", "/test-security-context.xml"}) public abstract class AbstractUnitTestWithDB extends AbstractTransactionalTestNGSpringContextTests { // Unfortunately...
**[Peter De Winter](https://jira.spring.io/secure/ViewProfile.jspa?name=mijathi)** commented Thanks [Sam Brannen](https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen). This was indeed a solution to our specific problem.
**[Sam Brannen](https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen)** commented [Martin Flower](https://jira.spring.io/secure/ViewProfile.jspa?name=sylvestris), if you've already got that code in static blocks, then there isn't really any functional difference between that and using an `@BeforeClass` method. The only...
**[Sam Brannen](https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen)** commented [Peter De Winter](https://jira.spring.io/secure/ViewProfile.jspa?name=mijathi), I'm glad that little trick solves your problem! In fact, it might remain the only way to have the system property set. Even if...
**[Sam Brannen](https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen)** commented For further ideas on how to set active profiles _programmatically_, you may be interested in my response to the [Spring integration tests with profile](http://stackoverflow.com/a/20571356/388980) thread on Stack...
**[Grigory Kislin](https://jira.spring.io/secure/ViewProfile.jspa?name=gkislin)** commented This is the sample of possible fix: http://stackoverflow.com/a/33044283/548473
**[Sam Brannen](https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen)** commented [GKislin](https://jira.spring.io/secure/ViewProfile.jspa?name=GKislin), indeed... that's a nice custom work-around. Thanks for sharing!
**[Wim Deblauwe](https://jira.spring.io/secure/ViewProfile.jspa?name=wim.deblauwe)** commented Voting for this as I have this question: http://stackoverflow.com/questions/41614368
**[Hussein Yapit](https://jira.spring.io/secure/ViewProfile.jspa?name=yapith)** commented Spring has been pretty consistent with runtime configuration (like system/env properties) trumping over compile-time config, except for this case. I argue it's a better design to allow...
**[Juergen Hoeller](https://jira.spring.io/secure/ViewProfile.jspa?name=juergen.hoeller)** commented This is strongly related to self-injection: That self-injected early bean reference gets flagged as such in `AbstractAutoProxyCreator`, expecting to see a pre-proxied instance in `postProcessAfterInitialization` which it...