"<wse:Expires>2034-06-26T21:07:00.000-08:00</wse:Expires>" +
"</wse:SubscribeResponse></soapenv:Body></soapenv:Envelope>";
public void testSOAP12EnvelopeToSubscription() throws Exception {
MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
SubscribeCommandBuilder builder = new SubscribeCommandBuilder(mc);
Subscription subscription = builder.toSubscription(
CommandBuilderTestUtils.payloadToSOAP12Envelope(REQUEST_PAYLOAD_SOAP12));
assertNotNull("The subscription object is null", subscription);
assertNotNull("The subscription id is null", subscription.getId());
assertEquals("Invalid expiration time", 2034968820000L,
subscription.getExpires().getTimeInMillis() +
TimeZone.getTimeZone("GMT-08:00").getOffset(0));
assertEquals("Invalid time zone offset", TimeZone.getDefault().getOffset(0),
subscription.getExpires().getTimeZone().getOffset(0));
assertEquals("Invalid endpoint url", "http://www.other.example.com/OnStormWarning",
subscription.getEndpointUrl());
assertEquals("Invalid address url", "http://www.other.example.com/OnStormWarning",
subscription.getAddressUrl());
assertEquals("Invalid filter dialect", "http://www.example.org/topicFilter",
subscription.getFilterDesc().getFilterDialect());
assertEquals("Invalid filter value", "weather.storms",
subscription.getFilterDesc().getFilterValue());
Exception expected = null;
try {
builder.toSubscription(
CommandBuilderTestUtils.payloadToSOAP12Envelope(REQUEST_PAYLOAD_SOAP12_EXPIRED));
} catch (Exception e) {
expected = e;
}
assertNotNull("The exception object is null", expected);