java - TestNG is not reading application properties file -
when running testclass reading value properties file. while application reading properly.
here's how test class looks like
public class testclass { @mock abc abc; @test public void testhealth() { assert.assertequals("ok",abc.health()); } }
here's how class abc looks like
public class abc { @autowired properties props; public string health() { return props.getmessage(); // returning null } }
i seeing following error.
java.lang.assertionerror: expected [null] found [ok] expected :null actual :ok
while properties file has message value.
Comments
Post a Comment