### Question:
ResponseTimeMessageOutInterceptor extends AbstractMessageResponseTimeInterceptor { public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); boolean forceDisabled = Boolean.FALSE.equals(ex.get("org.apache.cxf.management.counter.enabled")); if (!forceDisabled && isServiceCounterEnabled(ex)) { if (ex.get(Exception.class) != null) { endHandlingMessage(ex); return; } if (Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE))) { return; } if (isClient(message)) { if (ex.isOneWay()) { message.getInterceptorChain().add(ending); } beginHandlingMessage(ex); } else { endHandlingMessage(ex); } } } ResponseTimeMessageOutInterceptor(); void handleMessage(Message message); @Override void handleFault(Message message);  }### Answer:
@Test public void testServerMessageOut() { setupCounterRepository(true, false); setupExchangeForMessage(); setupOperationForMessage(); EasyMock.expect(message.get(Message.PARTIAL_RESPONSE_MESSAGE)).andReturn(Boolean.FALSE).anyTimes(); EasyMock.expect(message.getExchange()).andReturn(exchange); EasyMock.expect(message.get(Message.REQUESTOR_ROLE)).andReturn(Boolean.FALSE).anyTimes(); EasyMock.expect(exchange.getOutMessage()).andReturn(message).anyTimes(); EasyMock.expect(exchange.get("org.apache.cxf.management.counter.enabled")).andReturn(null); EasyMock.expect(exchange.get(Exception.class)).andReturn(null); EasyMock.expect(exchange.get(FaultMode.class)).andReturn(null); MessageHandlingTimeRecorder mhtr = EasyMock.createMock(MessageHandlingTimeRecorder.class); mhtr.endHandling(); EasyMock.expectLastCall(); mhtr.setFaultMode(null); EasyMock.expectLastCall(); EasyMock.expect(exchange.get(MessageHandlingTimeRecorder.class)).andReturn(mhtr).anyTimes(); EasyMock.replay(mhtr); EasyMock.replay(exchange); EasyMock.replay(message); rtmoi.handleMessage(message); EasyMock.verify(message); EasyMock.verify(bus); EasyMock.verify(exchange); EasyMock.verify(mhtr); }
@Test public void testClientMessageOut() { EasyMock.expect(message.get(Message.PARTIAL_RESPONSE_MESSAGE)).andReturn(Boolean.FALSE).anyTimes(); EasyMock.expect(message.getExchange()).andReturn(exchange); EasyMock.expect(exchange.getBus()).andReturn(bus); EasyMock.expect(exchange.get("org.apache.cxf.management.counter.enabled")).andReturn(null); EasyMock.replay(exchange); EasyMock.replay(message); rtmoi.handleMessage(message); EasyMock.verify(message); EasyMock.verify(exchange); }