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