Activating profiles for a test class

The Spring test module provides the @ActiveProfiles annotation inside the test class. This annotation activates the profile in the test environment. Beans associated with that profile are instantiated and also those beans which are not associated with any profile instantiated. For example, there are two profiles activated—prod and dev:

@RunWith(SpringJUnit4ClassRunner.class) 
@ContextConfiguration(classes=TestConfig.class) 
@ActiveProfiles( { "prod", "dev" } ) 
public class AccountServiceImplTest { 
   ... 
} 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset