CreateSnapshotBridgeResult extends BaseDTO { public String serialize() { JaxbJsonSerializer<CreateSnapshotBridgeResult> serializer = new JaxbJsonSerializer<>(CreateSnapshotBridgeResult.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException("Unable to create task result due to: " + e.getMessage()); } } CreateSnapshotBridgeResult();  CreateSnapshotBridgeResult(String snapshotId, SnapshotStatus status); String getSnapshotId(); void setSnapshotId(String snapshotId); SnapshotStatus getStatus(); void setStatus(SnapshotStatus status); String serialize(); static CreateSnapshotBridgeResult deserialize(String bridgeResult);  }
@Test public void testSerialize() { String snapshotId = "snapshot-id"; SnapshotStatus status = SnapshotStatus.INITIALIZED; CreateSnapshotBridgeResult params = new CreateSnapshotBridgeResult(snapshotId, status); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"snapshotId\":\"" + snapshotId + "\"")); assertThat(cleanResult, containsString("\"status\":\"" + status.name() + "\"")); }