java - Spring bean autowire for testing -


i have many spring services autowire:

@autowired private smartcardservice smartcardservice; 

i need dummy class testing , defined class extending original:

@service public class dummysmartcardservice extends smartcardservice{     ... } 

how can sure autowire take dummy instead of original service without changing autowired annotation?

thanks.

consider using @primary annotation. see here


Comments