bug5221: adjusted AbstractServerReplicationTestSetUp such that it handles the POST requests for replication operations properly now

This commit is contained in:
Axel Uhl
2020-07-07 01:13:46 +02:00
parent 4939e892e3
commit 5a6f14e810
3 changed files with 2 additions and 4 deletions
@@ -177,7 +177,6 @@ public abstract class AbstractServerReplicationTestSetUp<ReplicableInterface ext
ReplicationInstancesManager rim = new ReplicationInstancesManager();
masterReplicator = new ReplicationServiceImpl(exchangeName, exchangeHost, 0, rim, new SingletonReplicablesProvider(this.master));
replicaDescriptor = new ReplicaDescriptorImpl(InetAddress.getLocalHost(), serverUuid, "", new String[] { this.master.getId().toString() });
// connect to exchange host and local server running as master
// master server and exchange host can be two different hosts
ReplicationServiceTestImpl<ReplicableInterface> replicaReplicator = new ReplicationServiceTestImpl<ReplicableInterface>(exchangeName, exchangeHost, rim, replicaDescriptor,
@@ -305,7 +304,7 @@ public abstract class AbstractServerReplicationTestSetUp<ReplicableInterface ext
String request = readLine(inputStream);
logger.info("received request "+request);
PrintWriter pw = new PrintWriter(new OutputStreamWriter(s.getOutputStream()));
if (request.startsWith("POST /replication/replication")) {
if (request.equals("POST /replication/replication")) {
final ReplicationServlet servlet = new ReplicationServlet(new SingletonReplicablesProvider(master), /* replicationServiceTracker */ null);
final HttpServletRequest requestMock = Mockito.mock(HttpServletRequest.class);
Mockito.when(requestMock.getInputStream()).thenReturn(new ServletInputStream() {