I just read a post discussing loading properties in a Junit
( Loading Properties File In JUnit @BeforeClass )
The properties load seems to work but I am not sure how to reference the specific property in my unit test ...any ideas - I am trying to load the value of the testinput entry in my properties file ?
============================================================ Property file users.properties content :
testinput=D/somefolder/somefile
public class OrderRouterTest2 extends CamelSpringTestSupport {
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
return new ClassPathXmlApplicationContext("META-INF/spring/camel- context.xml");
}
@BeforeClass
public static void setUpBeforeClass() throws Exception {
final Properties props = new Properties();
final InputStream fileIn = OrderRouterTest2.class.getResourceAsStream("/**users.properties**");
**props.load(fileIn)**;
}
@Test
public void testSendToWebService() throws Exception {
// These don't work
String value1 = context.resolvePropertyPlaceholders("{{testinput}}");
String value2 = "I see ${testinput}";
String value3 = "I see {{testinput}}";
}