0

Need to set the @Value of the service class using power mockito not using Mockito. Tried to set the value using Reflection.utils(class , name , value) it did not work , Since the class was using PowerMockRunner.class.

    @Value("#'{test.codes}'")
    private List<String> testList;
    
    application-yml
    
    test:
      codes:005
Raushan Kumar
  • 1,195
  • 12
  • 21
user1669692
  • 119
  • 1
  • 3
  • 16
  • Does this answer your question? [Populating Spring @Value during Unit Test](https://stackoverflow.com/questions/17353327/populating-spring-value-during-unit-test) – tgdavies Apr 21 '23 at 00:44
  • I tried all the options , This is the exisitng class , I need to use the same semantics such that PowerMockRunner.class and need to use the property file in ubnit test case. – user1669692 Apr 21 '23 at 01:01
  • You haven't shown us what you did, or told us what went wrong, so it is hard to offer any specific advice. – tgdavies Apr 21 '23 at 01:19

0 Answers0