GetSnapshotContentsTaskParameters extends BaseDTO { public String serialize() { JaxbJsonSerializer<GetSnapshotContentsTaskParameters> serializer = new JaxbJsonSerializer<>(GetSnapshotContentsTaskParameters.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); int getPageNumber(); void setPageNumber(int pageNumber); int getPageSize(); void setPageSize(int pageSize); String getPrefix(); void setPrefix(String prefix); String serialize(); static GetSnapshotContentsTaskParameters deserialize(String taskParameters);  }
@Test public void testSerialize() { GetSnapshotContentsTaskParameters taskParams = new GetSnapshotContentsTaskParameters(); taskParams.setSnapshotId(snapshotId); taskParams.setPageNumber(pageNumber); taskParams.setPageSize(pageSize); taskParams.setPrefix(prefix); String result = taskParams.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"snapshotId\":\"" + snapshotId + "\"")); assertThat(cleanResult, containsString("\"pageNumber\":" + pageNumber + "")); assertThat(cleanResult, containsString("\"pageSize\":" + pageSize + "")); assertThat(cleanResult, containsString("\"prefix\":\"" + prefix + "\"")); }