CreateSnapshotBridgeParameters extends BaseDTO { public String serialize() { JaxbJsonSerializer<CreateSnapshotBridgeParameters> serializer = new JaxbJsonSerializer<>(CreateSnapshotBridgeParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task result due to: " + e.getMessage()); } } CreateSnapshotBridgeParameters();  CreateSnapshotBridgeParameters(String host,
                                          String port,
                                          String storeId,
                                          String spaceId,
                                          String description,
                                          String userEmail,
                                          String memberId); String getHost(); void setHost(String host); String getPort(); void setPort(String port); String getStoreId(); String getMemberId(); void setStoreId(String storeId); String getSpaceId(); void setSpaceId(String spaceId); String getDescription(); void setDescription(String description); String getUserEmail(); void setUserEmail(String userEmail); void setMemberId(String memberId); String serialize();  }
@Test public void testSerialize() { String description = "description"; CreateSnapshotBridgeParameters params = new CreateSnapshotBridgeParameters(host, port, storeId, spaceId, description, userEmail, memberId); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"host\":\"" + host + "\"")); assertThat(cleanResult, containsString("\"port\":\"" + port + "\"")); assertThat(cleanResult, containsString("\"storeId\":\"" + storeId + "\"")); assertThat(cleanResult, containsString("\"spaceId\":\"" + spaceId + "\"")); assertThat(cleanResult, containsString("\"description\":\"" + description + "\"")); assertThat(cleanResult, containsString("\"userEmail\":\"" + userEmail + "\"")); assertThat(cleanResult, containsString("\"memberId\":\"" + memberId + "\"")); }
@Test public void testEmptyDescription() { String description = ""; CreateSnapshotBridgeParameters params = new CreateSnapshotBridgeParameters(host, port, storeId, spaceId, description, userEmail, memberId); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"description\":\"" + description + "\"")); }
@Test public void testNullDescription() { String description = null; CreateSnapshotBridgeParameters params = new CreateSnapshotBridgeParameters(host, port, storeId, spaceId, description, userEmail, memberId); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"description\":null")); }