final AddressingContext addressingContext = AddressingContext.createRequestContext(registrationRequesterService, messageId) ;
addressingContext.addRelatesTo(new RelationshipType(relatesTo)) ;
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
final QName subcode = CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME ;
final SoapFault soapFault = new SoapFault10(soapFaultType, subcode, reason) ;
final TestRegistrationRequesterCallback callback = new TestRegistrationRequesterCallback() {
public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext)
{
assertEquals(addressingContext.getTo().getValue(), registrationRequesterService.getAddress().getValue());
assertEquals(addressingContext.getFrom().getAddress().getValue(), registrationCoordinatorService.getAddress().getValue());
assertNull(addressingContext.getReplyTo());
assertEquals(addressingContext.getMessageID().getValue(), messageId);
assertNotNull(soapFault) ;
assertEquals(soapFaultType, soapFault.getSoapFaultType()) ;
assertEquals(subcode, soapFault.getSubcode()) ;
assertEquals(reason, soapFault.getReason()) ;
}
};
final RegistrationRequesterProcessor requester = RegistrationRequesterProcessor.getRequester() ;
requester.registerCallback(relatesTo, callback) ;