GetUrlTaskResult { public String serialize() { JaxbJsonSerializer<GetUrlTaskResult> serializer = new JaxbJsonSerializer<>(GetUrlTaskResult.class); try { return serializer.serialize(this); } catch (IOException e) { throw new TaskDataException( "Unable to create task result due to: " + e.getMessage()); } } GetUrlTaskResult();  GetUrlTaskResult(String signedUrl); String getStreamUrl(); void setStreamUrl(String streamUrl); String serialize(); static GetUrlTaskResult deserialize(String taskResult);  }
@Test public void testSerialize() { GetUrlTaskResult taskResult = new GetUrlTaskResult(); taskResult.setStreamUrl(streamUrl); String result = taskResult.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"streamUrl\":\"" + streamUrl + "\"")); }