GetSnapshotBridgeResult extends BaseDTO { public String serialize() { JaxbJsonSerializer<GetSnapshotBridgeResult> serializer = new JaxbJsonSerializer<>(GetSnapshotBridgeResult.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException("Unable to create task result due to: " + e.getMessage()); } } GetSnapshotBridgeResult(); SnapshotStatus getStatus(); void setStatus(SnapshotStatus status); String getDescription(); void setDescription(String description); String getSnapshotId(); void setSnapshotId(String snapshotId); Date getSnapshotDate(); void setSnapshotDate(Date snapshotDate); String getSourceHost(); void setSourceHost(String sourceHost); String getSourceSpaceId(); void setSourceSpaceId(String sourceSpaceId); String getSourceStoreId(); void setSourceStoreId(String sourceStoreId); Long getContentItemCount(); void setContentItemCount(Long contentItemCount); Long getTotalSizeInBytes(); void setTotalSizeInBytes(Long totalSizeInBytes); List<String> getAlternateIds(); void setAlternateIds(List<String> alternateIds); String serialize(); static GetSnapshotBridgeResult deserialize(String bridgeResult); String getMemberId(); void setMemberId(String memberId);  }
@Test public void testSerialize() { GetSnapshotBridgeResult params = new GetSnapshotBridgeResult(); params.setStatus(status); params.setDescription(description); params.setSourceHost(sourceHost); params.setSourceSpaceId(sourceSpaceId); params.setSourceStoreId(sourceStoreId); params.setSnapshotId(snapshotId); params.setSnapshotDate(snapshotDate); params.setContentItemCount(contentItemCount); params.setTotalSizeInBytes(totalSizeInBytes); params.setAlternateIds(alternateIds); params.setMemberId(memberId); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"status\":\"" + status.name() + "\"")); assertThat(cleanResult, containsString("\"description\":\"" + description + "\"")); assertThat(cleanResult, containsString("\"sourceHost\":\"" + sourceHost + "\"")); assertThat(cleanResult, containsString("\"sourceSpaceId\":\"" + sourceSpaceId + "\"")); assertThat(cleanResult, containsString("\"sourceStoreId\":\"" + sourceStoreId + "\"")); assertThat(cleanResult, containsString("\"snapshotDate\":" + snapshotDate.getTime())); assertThat(cleanResult, containsString("\"description\":\"" + description + "\"")); assertThat(cleanResult, containsString("\"contentItemCount\":" + contentItemCount)); assertThat(cleanResult, containsString("\"totalSizeInBytes\":" + totalSizeInBytes)); assertThat(cleanResult, containsString("\"memberId\":\"" + memberId + "\"")); assertThat(cleanResult, containsString("\"alternateIds\":[\"" + alternateId1 + "\",\"" + alternateId2 + "\"]")); GetSnapshotBridgeResult params2 = GetSnapshotBridgeResult.deserialize(result); assertEquals(description, params2.getDescription()); assertEquals(sourceHost, params2.getSourceHost()); assertEquals(sourceSpaceId, params2.getSourceSpaceId()); assertEquals(sourceStoreId, params2.getSourceStoreId()); assertEquals(snapshotDate, params2.getSnapshotDate()); assertEquals(snapshotId, params2.getSnapshotId()); assertEquals(contentItemCount, params2.getContentItemCount()); assertEquals(totalSizeInBytes, params2.getTotalSizeInBytes()); assertEquals(alternateIds, params2.getAlternateIds()); }