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