CompleteCancelSnapshotTaskParameters extends BaseDTO { public String serialize() { JaxbJsonSerializer<CompleteCancelSnapshotTaskParameters> serializer = new JaxbJsonSerializer<>(CompleteCancelSnapshotTaskParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task parameters due to: " + e.getMessage()); } } CompleteCancelSnapshotTaskParameters();  CompleteCancelSnapshotTaskParameters(String spaceId); String getSpaceId(); void setSpaceId(String spaceId); String serialize(); static CompleteCancelSnapshotTaskParameters deserialize(String taskParameters);  }
@Test public void testSerialize() { String spaceId = "space-id"; CompleteCancelSnapshotTaskParameters taskParams = new CompleteCancelSnapshotTaskParameters(spaceId); String result = taskParams.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"spaceId\":\"" + spaceId + "\"")); }