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