CreateSnapshotTaskRunner extends SpaceModifyingSnapshotTaskRunner { protected String buildSnapshotProps(Map<String, String> props) { Properties snapshotProperties = new Properties(); for (String key : props.keySet()) { snapshotProperties.setProperty(key, props.get(key)); } StringWriter writer = new StringWriter(); try { snapshotProperties.store(writer, null); } catch (IOException e) { throw new TaskException("Could not write snapshot properties: " + e.getMessage(), e); } writer.flush(); return writer.toString(); } CreateSnapshotTaskRunner(StorageProvider snapshotProvider,
                                    SnapshotStorageProvider unwrappedSnapshotProvider,
                                    String dcHost,
                                    String dcPort,
                                    String dcStoreId,
                                    String dcAccountName,
                                    String dcSnapshotUser,
                                    String bridgeAppHost,
                                    String bridgeAppPort,
                                    String bridgeAppUser,
                                    String bridgeAppPass,
                                    String bridgeMemberId); @Override String getName(); @Override String performTask(String taskParameters);  }
@Test public void testBuildSnapshotProps() throws Exception { replayMocks(); Map<String, String> propsMap = new HashMap<>(); propsMap.put("one", "two"); propsMap.put("three", "four"); String props = taskRunner.buildSnapshotProps(propsMap); assertTrue(props.contains("one=two")); assertTrue(props.contains("three=four")); Properties realProps = new Properties(); realProps.load(new StringReader(props)); assertEquals("two", realProps.getProperty("one")); assertEquals("four", realProps.getProperty("three")); }