Is it possible to disable log execution during testing?
I have this class
public class UnitTestMe {
private final MockMe mockMe;
private final SomethingElse something;
private final Logger logger = LoggerFactory.getLogger(this.getClass().getClass());
public UnitTestMe(MockMe mockMe, SomethingElse something) {
this..
}
public toTest() {
logger.info("Executing toTest. MockMe a: {}, Foo: b: {}", mockMe.toString(), something.foo().bar());
mockMe.execute();
}
}
My Unit Test does not work with NullPointerException because something.foo () is not a mocked object (I use mockito with nicemock).
How can I test this class without deleting the log statement and without taunting the irrelevant parts of the type dependencies something?
Edit: something in this case is a client object that is not used in a function toTest(), but is needed in other parts of this class. I use the Customer class in a logger statement to associate an action with a user.
2: ? , NullPointerException, `something' .
user524824