title: How Hybris is managing Application Contexts between the application and integration tests
body: <p>I am currently new to Hybris and I am writing integration tests, which is awesome however it is hard for me to understand the concept of junit tenant and how Hybris is managing the application context for that tenant.</p>
  
  <p>I come from a spring background, and there I can say it was easy to load a separate test configuration or any configuration, and just to test it without affecting the main run time application context that is used lets say for debugging at the same time.</p>
  
  <p>However in Hybris, I am kind of confused because while the server is running you can easily swap between tenants and execute integration test at the same time when lets say some user is buying something. </p>
  
  <p>Does Hybris has separate application context for junit and master tenant ?
  And regardless of yes or no, how is Hybris managing the application contexts between tenants ?</p>
  
  <p>I first encounter this problem when I was declaring the ehCacheManager bean, and suddenly all my tests started to fail - something that the cache is in SHUTDOWN mode ... which was strange.</p>
  
  <p>Is the application context shared between tenants ? 
  Is it shared between two separate integration tests ?
  Is it destroyed after one test, then created for another integration test ?</p>
  
  <p>I know that some of this questions might seems confusing or even stupid, but I will be glad if someone can explain me how hybris is managing the application context between tenant and tests, furthermore I will be really grateful if you can share some resources or books on this topic.</p>
  
  <p>Thanks in advance !!!</p>