public void testSOAP12EnvelopeToSubscription() throws Exception {
MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
SubscribeCommandBuilder builder = new SubscribeCommandBuilder(mc);
Subscription subscription = builder.toSubscription(
CommandBuilderTestUtils.payloadToSOAP12Envelope(REQUEST_PAYLOAD_SOAP12));
subscription.setId("uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa");
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.getEventSinkURL());
Exception expected = null;
try {
builder.toSubscription(
CommandBuilderTestUtils.payloadToSOAP12Envelope(REQUEST_PAYLOAD_SOAP12_EXPIRED));