I want to make "logger.isDebugEnabled()" from groovy spock.Such as
logger.isDebugEnabled() >> false
my code is
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.PropertyResolver;
public class Sample{
public static final Logger logger = LoggerFactory.getLogger(Sample.class);
public void checkForAllRequiredProperties(String scope) {
if (logger.isDebugEnabled()) {
logger.debug("some message ");
}
}
}
but logger
is private static final
i not able mocking logger.isDebugEnabled()