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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -