I would like to test a method from class1
which calls the singleton class getInstance
:
Class ivDomain {
public String method1() {
id=Singleton.getInstance().generateId()
... code
}
}
When I do the test using Junit I am getting NullPointerException
on the singleton class. How can I fix this?