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