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