CleanupSnapshotTaskResult extends BaseDTO { public String serialize() { JaxbJsonSerializer<CleanupSnapshotTaskResult> serializer = new JaxbJsonSerializer<>(CleanupSnapshotTaskResult.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task result due to: " + e.getMessage()); } } CleanupSnapshotTaskResult();  CleanupSnapshotTaskResult(int contentExpirationDays); int getContentExpirationDays(); void setContentExpirationDays(int contentExpirationDays); String serialize(); static CleanupSnapshotTaskResult deserialize(String taskResult);  }
@Test public void testSerialize() { String result = new CleanupSnapshotTaskResult(expirationDays).serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"contentExpirationDays\":" + expirationDays)); }