Logger logger = LogManager.getLogger(CheckingObjectOutputStream.class);
logger.setLevel(Level.WARN);
Log4jEventHistory logHistory = new Log4jEventHistory();
logger.addAppender(logHistory);
CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
new ObjectSerializationChecker(new NotSerializableException()));
try
{
checker.writeObject(new TestType1());
String expectedMessage = "Wasn't possible to check the object 'class org.apache.wicket.util.io.SerializableCheckerTest$ProblematicType' possible due an problematic implementation of equals method";
assertTrue(logHistory.contains(Level.WARN, expectedMessage));