RequestRestoreSnapshotTaskRunner extends AbstractSnapshotTaskRunner { protected String buildBridgeBody(String snapshotId, String userEmail) { RequestRestoreBridgeParameters bridgeParams = new RequestRestoreBridgeParameters(dcHost, dcPort, dcStoreId, snapshotId, userEmail); return bridgeParams.serialize(); } RequestRestoreSnapshotTaskRunner(String dcHost,
                                            String dcPort,
                                            String dcStoreId,
                                            String dcSnapshotUser,
                                            String bridgeAppHost,
                                            String bridgeAppPort,
                                            String bridgeAppUser,
                                            String bridgeAppPass); @Override String getName(); @Override String performTask(String taskParameters);  }
@Test public void testBuildBridgeBody() { replayMocks(); String snapshotId = "snapshot-id"; String userEmail = "user-email"; String result = taskRunner.buildBridgeBody(snapshotId, userEmail); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"host\":\"" + dcHost + "\"")); assertThat(cleanResult, containsString("\"port\":\"" + dcPort + "\"")); assertThat(cleanResult, containsString("\"storeId\":\"" + dcStoreId + "\"")); assertThat(cleanResult, containsString("\"snapshotId\":\"" + snapshotId + "\"")); assertThat(cleanResult, containsString("\"userEmail\":\"" + userEmail + "\"")); }