ByteArrayInputStream error = new ByteArrayInputStream("".getBytes());
Object object = new TestingApiContext(environment, input, output, error)
.reportsRequester()
// the specific number is mocked and doesn't matter, but the parsing _does_...
.requestNotification("c821426e-7caa-4d51-9b2e-48ef7ecd6423");
OrderStateChangeNotification oscn = (OrderStateChangeNotification)object;
assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
+ "<notification-history-request xmlns=\"http://checkout.google.com/schema/2\">\n"
+ " <serial-number>c821426e-7caa-4d51-9b2e-48ef7ecd6423</serial-number>\n"
+ "</notification-history-request>\n", output.toString("utf-8"));
// textually identical to the XML EXAMPLE_NOTIFICATION string.
assertEquals("841171949013218", oscn.getGoogleOrderNumber());
assertEquals(FinancialOrderState.CHARGING, oscn.getNewFinancialOrderState());
assertEquals(FinancialOrderState.CHARGEABLE, oscn.getPreviousFinancialOrderState());
assertEquals(FulfillmentOrderState.NEW, oscn.getNewFulfillmentOrderState());
assertEquals(FulfillmentOrderState.NEW, oscn.getPreviousFulfillmentOrderState());
assertEquals(DATE_STRING, oscn.getTimestamp().toXMLFormat());
}