public void testDeliverPackage() throws Exception {
TransportAuthenticationProvider<Executor, Executor> authProvider = mock(TransportAuthenticationProvider.class);
when(authProvider.canAuthenticate(Executor.class)).thenReturn(true);
Executor executor = mock(Executor.class);
Response response = mock(Response.class);
when(executor.execute(any(Request.class))).thenReturn(response);
when(authProvider.authenticate(any(Executor.class), any(TransportAuthenticationContext.class))).thenReturn(executor);
ReplicationEndpoint endpoint = new ReplicationEndpoint("http://127.0.0.1:8080/some/resource");
ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
int maxNoOfPackages = Integer.MAX_VALUE;
SimpleHttpReplicationTransportHandler simpleHttpReplicationTransportHandler = new SimpleHttpReplicationTransportHandler(