Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
JaggerPropertiesProvider.java
Go to the documentation of this file.
1 package ${package}.util;
2 
3 import com.griddynamics.jagger.util.JaggerXmlApplicationContext;
4 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.context.ApplicationContext;
6 import org.springframework.context.annotation.Configuration;
7 import org.springframework.context.annotation.PropertySource;
8 import org.springframework.core.env.Environment;
9 
16 @Configuration
17 @PropertySource("classpath:test.properties")
19 
20  @Autowired
21  private ApplicationContext jaggerContext;
22 
23  @Autowired
24  private Environment testEnv;
25 
26  public String getEnvPropertyValue(String key) {
27  return ((JaggerXmlApplicationContext) jaggerContext).getEnvironmentProperties().getProperty(key);
28  }
29 
30  public String getTestPropertyValue(String key) {
31  return testEnv.getRequiredProperty(key);
32  }
33 }