CleanupSnapshotTaskResult extends BaseDTO { public static CleanupSnapshotTaskResult deserialize(String taskResult) { JaxbJsonSerializer<CleanupSnapshotTaskResult> serializer = new JaxbJsonSerializer<>(CleanupSnapshotTaskResult.class); try { return serializer.deserialize(taskResult); } 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 testDeserialize() { String taskParamsSerialized = "{\"contentExpirationDays\" : " + expirationDays + "}"; CleanupSnapshotTaskResult taskResult = CleanupSnapshotTaskResult.deserialize(taskParamsSerialized); assertThat(expirationDays, equalTo(taskResult.getContentExpirationDays())); }