I am unsure on how to mock an enum singleton class.
public enum SingletonObject{
INSTANCE;
private int num;
protected setNum(int num) {
this.num =
In addition to above Matt Lachman answer, create a object factory for power mock in SingleTonConsumerTest.class
@ObjectFactory
public IObjectFactory getObjectFactory() {
return new org.powermock.modules.testng.PowerMockObjectFactory();
}
This will remove Mockito cannot mock/spy following: - final classes - anonymous classes - primitive types error.