GetUrlTaskParameters { public String serialize() { JaxbJsonSerializer<GetUrlTaskParameters> serializer = new JaxbJsonSerializer<>(GetUrlTaskParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new TaskDataException( "Unable to create task parameters due to: " + e.getMessage()); } } GetUrlTaskParameters(); String getSpaceId(); void setSpaceId(String spaceId); String getContentId(); void setContentId(String contentId); String getResourcePrefix(); void setResourcePrefix(String resourcePrefix); String serialize(); static GetUrlTaskParameters deserialize(String taskParameters);  }
@Test public void testSerialize() { GetUrlTaskParameters taskParams = new GetUrlTaskParameters(); taskParams.setSpaceId(spaceId); taskParams.setContentId(contentId); taskParams.setResourcePrefix(resourcePrefix); String result = taskParams.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"spaceId\":\"" + spaceId + "\"")); assertThat(cleanResult, containsString("\"contentId\":\"" + contentId + "\"")); assertThat(cleanResult, containsString("\"resourcePrefix\":\"" + resourcePrefix + "\"")); }