GetSignedCookiesUrlTaskParameters { public String serialize() { JaxbJsonSerializer<GetSignedCookiesUrlTaskParameters> serializer = new JaxbJsonSerializer<>(GetSignedCookiesUrlTaskParameters.class); try { return serializer.serialize(this); } catch (IOException e) { throw new TaskDataException( "Unable to create task parameters due to: " + e.getMessage()); } } GetSignedCookiesUrlTaskParameters(); String getSpaceId(); void setSpaceId(String spaceId); int getMinutesToExpire(); void setMinutesToExpire(int minutesToExpire); String getIpAddress(); void setIpAddress(String ipAddress); String getRedirectUrl(); void setRedirectUrl(String redirectUrl); String serialize(); static GetSignedCookiesUrlTaskParameters deserialize(String taskParameters); static final int USE_DEFAULT_MINUTES_TO_EXPIRE; }
@Test public void testSerialize() { GetSignedCookiesUrlTaskParameters taskParams = new GetSignedCookiesUrlTaskParameters(); taskParams.setSpaceId(spaceId); taskParams.setMinutesToExpire(minutesToExpire); taskParams.setIpAddress(ipAddress); taskParams.setRedirectUrl(redirectUrl); String result = taskParams.serialize(); String cleanResult = result.replaceAll("\\s+", ""); assertThat(cleanResult, containsString("\"spaceId\":\"" + spaceId + "\"")); assertThat(cleanResult, containsString("\"minutesToExpire\":" + minutesToExpire)); assertThat(cleanResult, containsString("\"ipAddress\":\"" + ipAddress + "\"")); assertThat(cleanResult, containsString("\"redirectUrl\":\"" + redirectUrl + "\"")); }