@Test public void onSuccess_NoRequest() { final RequestBuilder rb = mock( RequestBuilder.class ); final RequestCallback callback = mock( RequestCallback.class ); final SystemSchema schema = newSchema(); createConnector( schema ); new ReplicantRpcRequestBuilder( ValueUtil.randomString(), schema.getId() ).doSetCallback( rb, callback ); verify( rb ).setCallback( eq( callback ) ); verify( rb, never() ).setHeader( eq( SharedConstants.CONNECTION_ID_HEADER ), anyString() ); verify( rb, never() ).setHeader( eq( SharedConstants.REQUEST_ID_HEADER ), anyString() ); }
@Override protected void doSetCallback( final RequestBuilder rb, final RequestCallback callback ) { final ReplicantContext context = Replicant.context(); if ( context.hasCurrentRequest( _schemaId ) ) { final Request request = context.currentRequest( _schemaId ); rb.setHeader( SharedConstants.CONNECTION_ID_HEADER, request.getConnectionId() ); rb.setHeader( SharedConstants.REQUEST_ID_HEADER, String.valueOf( request.getRequestId() ) ); rb.setCallback( new ReplicantRequestCallback( request, callback ) ); } else { super.doSetCallback( rb, callback ); } }
ReplicantRpcRequestBuilder extends RpcRequestBuilder { @Override protected void doSetCallback( final RequestBuilder rb, final RequestCallback callback ) { final ReplicantContext context = Replicant.context(); if ( context.hasCurrentRequest( _schemaId ) ) { final Request request = context.currentRequest( _schemaId ); rb.setHeader( SharedConstants.CONNECTION_ID_HEADER, request.getConnectionId() ); rb.setHeader( SharedConstants.REQUEST_ID_HEADER, String.valueOf( request.getRequestId() ) ); rb.setCallback( new ReplicantRequestCallback( request, callback ) ); } else { super.doSetCallback( rb, callback ); } } }
ReplicantRpcRequestBuilder extends RpcRequestBuilder { @Override protected void doSetCallback( final RequestBuilder rb, final RequestCallback callback ) { final ReplicantContext context = Replicant.context(); if ( context.hasCurrentRequest( _schemaId ) ) { final Request request = context.currentRequest( _schemaId ); rb.setHeader( SharedConstants.CONNECTION_ID_HEADER, request.getConnectionId() ); rb.setHeader( SharedConstants.REQUEST_ID_HEADER, String.valueOf( request.getRequestId() ) ); rb.setCallback( new ReplicantRequestCallback( request, callback ) ); } else { super.doSetCallback( rb, callback ); } } ReplicantRpcRequestBuilder( @Nonnull final String baseUrl, final int schemaId ); }
ReplicantRpcRequestBuilder extends RpcRequestBuilder { @Override protected void doSetCallback( final RequestBuilder rb, final RequestCallback callback ) { final ReplicantContext context = Replicant.context(); if ( context.hasCurrentRequest( _schemaId ) ) { final Request request = context.currentRequest( _schemaId ); rb.setHeader( SharedConstants.CONNECTION_ID_HEADER, request.getConnectionId() ); rb.setHeader( SharedConstants.REQUEST_ID_HEADER, String.valueOf( request.getRequestId() ) ); rb.setCallback( new ReplicantRequestCallback( request, callback ) ); } else { super.doSetCallback( rb, callback ); } } ReplicantRpcRequestBuilder( @Nonnull final String baseUrl, final int schemaId );  }
ReplicantRpcRequestBuilder extends RpcRequestBuilder { @Override protected void doSetCallback( final RequestBuilder rb, final RequestCallback callback ) { final ReplicantContext context = Replicant.context(); if ( context.hasCurrentRequest( _schemaId ) ) { final Request request = context.currentRequest( _schemaId ); rb.setHeader( SharedConstants.CONNECTION_ID_HEADER, request.getConnectionId() ); rb.setHeader( SharedConstants.REQUEST_ID_HEADER, String.valueOf( request.getRequestId() ) ); rb.setCallback( new ReplicantRequestCallback( request, callback ) ); } else { super.doSetCallback( rb, callback ); } } ReplicantRpcRequestBuilder( @Nonnull final String baseUrl, final int schemaId );   }