@Test public void shouldSetRelayStateForSamlGetRequests() throws Exception { HttpMessage requestMessage = TestConstants.samlGetRequestMessage; SAMLMessage samlMessage = new SAMLMessage(requestMessage); samlMessage.setRelayState("newValueReq"); HttpMessage changedHttpMessage = samlMessage.getChangedMessage(); String relayState = new SAMLMessage(changedHttpMessage).getRelayState(); assertEquals(relayState.trim(), "newValueReq"); HttpMessage responseMessage = TestConstants.samlGetResponseMessage; samlMessage = new SAMLMessage(responseMessage); samlMessage.setRelayState("newValueRsp"); changedHttpMessage = samlMessage.getChangedMessage(); relayState = new SAMLMessage(changedHttpMessage).getRelayState(); assertEquals(relayState.trim(), "newValueRsp"); }