### Question:
AbstractRMInterceptor extends AbstractPhaseInterceptor<T> { public void handleMessage(Message msg) throws Fault { try { handle(msg); } catch (SequenceFault sf) { Endpoint e = msg.getExchange().getEndpoint(); Binding b = null; if (null != e) { b = e.getBinding(); } if (null != b) { RMManager m = getManager(); LOG.fine("Manager: " + m); BindingFaultFactory bff = m.getBindingFaultFactory(b); Fault f = bff.createFault(sf, msg); LogUtils.log(LOG, Level.WARNING, "SEQ_FAULT_MSG", bff.toString(f)); throw f; } throw new Fault(sf); } catch (RMException ex) { throw new Fault(ex); } } protected  AbstractRMInterceptor(String phase); protected  AbstractRMInterceptor(); RMManager getManager(); void setManager(RMManager m); Bus getBus(); void setBus(Bus bus); void handleMessage(Message msg);  }### Answer:
@Test public void testHandleMessageSequenceFaultNoBinding() { RMInterceptor interceptor = new RMInterceptor(); Message message = control.createMock(Message.class); SequenceFault sf = control.createMock(SequenceFault.class); interceptor.setSequenceFault(sf); Exchange ex = control.createMock(Exchange.class); EasyMock.expect(message.getExchange()).andReturn(ex).anyTimes(); Endpoint e = control.createMock(Endpoint.class); EasyMock.expect(ex.getEndpoint()).andReturn(e); EasyMock.expect(e.getBinding()).andReturn(null); control.replay(); try { interceptor.handleMessage(message); fail("Expected Fault not thrown."); } catch (Fault f) { assertSame(sf, f.getCause()); } }
@Test public void testHandleMessageRMException() { RMInterceptor interceptor = new RMInterceptor(); Message message = control.createMock(Message.class); RMException rme = control.createMock(RMException.class); interceptor.setRMException(rme); control.replay(); try { interceptor.handleMessage(message); fail("Expected Fault not thrown."); } catch (Fault f) { assertSame(rme, f.getCause()); } }