Skip to content
Advertisement

Unit testing with inject annotation

How do I unit test a class that uses @inject annotation:class A{

JavaScript

I am new to unit testing and having troubles testing this function because when calling b.funcInClassB() it throws NullPointerException because b is null. I wrote the following test:

JavaScript

Advertisement

Answer

I figured it out:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement