### Question:
RMSoapInInterceptor extends AbstractSoapInterceptor { public void handleMessage(SoapMessage message) throws Fault { decode(message); updateServiceModelInfo(message); } RMSoapInInterceptor(); Set<QName> getUnderstoodHeaders(); void handleMessage(SoapMessage message); RMProperties unmarshalRMProperties(SoapMessage message); void decodeHeaders(SoapMessage message, List<Header> headers, RMProperties rmps);  }### Answer:
@Test public void testDecodeSequence() throws XMLStreamException { SoapMessage message = setUpInboundMessage("resources/Message1.xml"); RMSoapInInterceptor codec = new RMSoapInInterceptor(); codec.handleMessage(message); RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false); SequenceType st = rmps.getSequence(); assertNotNull(st); assertEquals(st.getIdentifier().getValue(), SEQ_IDENTIFIER); assertEquals(st.getMessageNumber(), MSG1_MESSAGE_NUMBER); assertNull(rmps.getAcks()); assertNull(rmps.getAcksRequested()); }
@Test public void testDecodeAcknowledgements() throws XMLStreamException { SoapMessage message = setUpInboundMessage("resources/Acknowledgment.xml"); RMSoapInInterceptor codec = new RMSoapInInterceptor(); codec.handleMessage(message); RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false); Collection<SequenceAcknowledgement> acks = rmps.getAcks(); assertNotNull(acks); assertEquals(1, acks.size()); SequenceAcknowledgement ack = acks.iterator().next(); assertNotNull(ack); assertEquals(ack.getIdentifier().getValue(), SEQ_IDENTIFIER); assertEquals(2, ack.getAcknowledgementRange().size()); AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0); AcknowledgementRange r2 = ack.getAcknowledgementRange().get(1); verifyRange(r1, 1, 1); verifyRange(r2, 3, 3); assertNull(rmps.getSequence()); assertNull(rmps.getAcksRequested()); }
@Test public void testDecodeAcknowledgements2() throws XMLStreamException { SoapMessage message = setUpInboundMessage("resources/Acknowledgment2.xml"); RMSoapInInterceptor codec = new RMSoapInInterceptor(); codec.handleMessage(message); RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false); Collection<SequenceAcknowledgement> acks = rmps.getAcks(); assertNotNull(acks); assertEquals(1, acks.size()); SequenceAcknowledgement ack = acks.iterator().next(); assertNotNull(ack); assertEquals(1, ack.getAcknowledgementRange().size()); AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0); verifyRange(r1, 1, 3); assertNull(rmps.getSequence()); assertNull(rmps.getAcksRequested()); }
@Test public void testDecodeAcksRequested() throws XMLStreamException { SoapMessage message = setUpInboundMessage("resources/Retransmission.xml"); RMSoapInInterceptor codec = new RMSoapInInterceptor(); codec.handleMessage(message); RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false); Collection<AckRequestedType> requested = rmps.getAcksRequested(); assertNotNull(requested); assertEquals(1, requested.size()); AckRequestedType ar = requested.iterator().next(); assertNotNull(ar); assertEquals(ar.getIdentifier().getValue(), SEQ_IDENTIFIER); SequenceType s = rmps.getSequence(); assertNotNull(s); assertEquals(s.getIdentifier().getValue(), SEQ_IDENTIFIER); assertEquals(s.getMessageNumber(), MSG2_MESSAGE_NUMBER); assertNull(rmps.getAcks()); }