0

I am using @Inject annotation for injecting interface(IFMJobHandler is an interface) in my class like this

@Inject
@Reference
IFMJobHandler jobHandler;

While running application with JUnit test, jobHandler property returning null value because of spring annotations for that interface.

Kindly let me know to solve this issue

dunni
  • 43,386
  • 10
  • 104
  • 99
  • Welcome to stack overflow :-) Please look at [ask] and how to create a [mcve]. This will help to get useful answers. – JimHawkins Aug 18 '16 at 07:01

1 Answers1

0

Most likely the problem is that you are trying to run a simple unit test. But in such case there's no Spring Context and nothing is injected. See this link about how to run Spring test - testing

mark_o
  • 2,052
  • 1
  • 12
  • 18