UpdateSnapshotHistoryBridgeParameters { public String serialize() { JaxbJsonSerializer<UpdateSnapshotHistoryBridgeParameters> serializer = new JaxbJsonSerializer<>(UpdateSnapshotHistoryBridgeParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new SnapshotDataException( "Unable to create task result due to: " + e.getMessage()); } } UpdateSnapshotHistoryBridgeParameters();  UpdateSnapshotHistoryBridgeParameters(Boolean alternate, String history); Boolean getAlternate(); void setAlternate(Boolean alternate); String getHistory(); void setHistory(String history); String serialize();  }
@Test public void testSerialize() { Boolean alternate = true; String history = "history"; UpdateSnapshotHistoryBridgeParameters params = new UpdateSnapshotHistoryBridgeParameters(alternate, history); String result = params.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"alternate\":" + alternate + "")); assertThat(cleanResult, containsString("\"history\":\"" + history + "\"")); }