{
final String protocolIdentifier = "http://foo.example.org/bar" ;
final W3CEndpointReference participantProtocolEndpoint = TestUtil11.getProtocolParticipantEndpoint("participant");
String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null);
W3CEndpointReference registerEndpoint = TestUtil11.getRegistrationEndpoint(identifier);
RegisterType registerType = new RegisterType();
RegisterResponseType response;
registerType.setProtocolIdentifier(protocolIdentifier);
registerType.setParticipantProtocolService(participantProtocolEndpoint);
RegistrationPortType port = WSCOORClient.getRegistrationPort(registerEndpoint, CoordinationConstants.WSCOOR_ACTION_REGISTER, messageId);
response = port.registerOperation(registerType);
final RegisterDetails details = testRegistrationCoordinatorProcessor.getRegisterDetails(messageId, 10000) ;
final RegisterType requestRegister = details.getRegister() ;
final AddressingProperties requestAddressingProperties = details.getAddressingProperties() ;
final ArjunaContext requestArjunaContext = details.getArjunaContext() ;
assertEquals(requestAddressingProperties.getTo().getURI().toString(), TestUtil11.registrationCoordinatorService);
assertEquals(requestAddressingProperties.getMessageID().getURI().toString(), messageId);
if (instanceIdentifier == null)
{
assertNull(requestArjunaContext) ;
}
else
{
assertEquals(instanceIdentifier.getInstanceIdentifier(), requestArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
}
assertEquals(protocolIdentifier, requestRegister.getProtocolIdentifier()) ;
}