GetSnapshotTaskParameters extends BaseDTO { public String serialize() { JaxbJsonSerializer<GetSnapshotTaskParameters> serializer = new JaxbJsonSerializer<>(GetSnapshotTaskParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task parameters due to: " + e.getMessage()); } }  String getSnapshotId(); void setSnapshotId(String snapshotId); String serialize(); static GetSnapshotTaskParameters deserialize(String taskParameters);  }
@Test public void testSerialize() { String snapshotId = "snapshot-id"; GetSnapshotTaskParameters taskParams = new GetSnapshotTaskParameters(); taskParams.setSnapshotId(snapshotId); String result = taskParams.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"snapshotId\":\"" + snapshotId + "\"")); }