### Question:
SoapFaultFactory implements BindingFaultFactory { Fault createSoap12Fault(SequenceFault sf, Message msg) { SoapFault fault = (SoapFault)createSoap11Fault(sf); fault.setSubCode(sf.getFaultCode()); Object detail = sf.getDetail(); if (null == detail) { return fault; } try { RMProperties rmps = RMContextUtils.retrieveRMProperties(msg, false); AddressingProperties maps = RMContextUtils.retrieveMAPs(msg, false, false); EncoderDecoder codec = ProtocolVariation.findVariant(rmps.getNamespaceURI(), maps.getNamespaceURI()).getCodec(); setDetail(fault, detail, codec); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "MARSHAL_FAULT_DETAIL_EXC", ex); ex.printStackTrace(); } return fault; } SoapFaultFactory(Binding binding); Fault createFault(SequenceFault sf, Message msg); String toString(Fault f);  }### Answer:
@Test public void createSoap12Fault() { SoapBinding sb = control.createMock(SoapBinding.class); EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance()); Identifier id = new Identifier(); id.setValue("sid"); setupSequenceFault(true, RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, id); control.replay(); SoapFaultFactory factory = new SoapFaultFactory(sb); SoapFault fault = (SoapFault)factory.createFault(sf, createInboundMessage()); assertEquals("reason", fault.getReason()); assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode()); assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, fault.getSubCode()); Element elem = fault.getDetail(); assertEquals(RM10Constants.NAMESPACE_URI, elem.getNamespaceURI()); assertEquals("Identifier", elem.getLocalName()); assertNull(fault.getCause()); control.verify(); }