I have a Logger that is private static final which utilizes a server. I would like to suppress the Logger method debug, or suppress any and all interactions with the variable. I declare the logger in LoggingClass
private static final Logger LOGGER = LoggerFactory.getLogger("LoggingClass");
The javadoc for the debug is :
public abstract void debug(String s, Object aobj[]);
In the test class I have tried:
PowerMockito.suppress(PowerMockito.method(Logger.class, "debug", String.class, Object[].class));
Problem : Throws toomanyMethodsException
===========
Logger nullLogger= null;
LoggingClass lc= new LoggingClass(); //This is the class that uses the logger
Whitebox.setInternalState(lc, "LOGGER",nullLogger);
Problem: Throws that Whitebox can not find the instance field LOGGER.
Any assistance would be appreicated