### Question:
HttpConfigHandler extends IoHandlerAdapter { @Override public void messageReceived(IoSession session, Object message) throws Exception { HttpMessage httpMessage = (HttpMessage)message; try { if ( httpMessage.getRequestUri() != null ) { String variable = null; if ( httpMessage.getRequestUri().indexOf('?') >= 0 ) { variable = substring(httpMessage.getRequestUri(), "?", null); } String url = substring(httpMessage.getRequestUri(), null, HTTP); String uri = substringR(url, PATH_SEP, QUESTION).trim(); if ( log.isDebugEnabled() ) { log.debug("Request url: " + url + ". uri: " + uri + ", variable: " + variable); } byte[] configData = null; httpMessage.setResponseContent(configData); } else { httpMessage.setResponseContent(NOT_FOUND_MSG); } } catch (Throwable e1) { e1.printStackTrace(); } WriteFuture future = session.write(httpMessage); } HttpConfigHandler(); static void reloadConfig(); @Override void sessionOpened(IoSession session); @Override void sessionClosed(IoSession session); @Override void sessionIdle(IoSession session, IdleStatus status); @Override void messageReceived(IoSession session, Object message); @Override void exceptionCaught(IoSession session, Throwable cause);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testMessageReceivedIoSessionObject() throws Exception { HttpConfigHandler handler = new HttpConfigHandler(); IoSession session = createNiceMock(IoSession.class); expect(session.isConnected()).andReturn(Boolean.TRUE).anyTimes(); replay(session); HttpMessage message = new HttpMessage(); message.setRequestUri("/equipment_config.lua"); try { handler.messageReceived(session, message); } catch (Exception e) { e.printStackTrace(); } }