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