Add ability to see raw response from server when something goes wrong. (OC Transpo...
[frank.git] / test / net / jaekl / qd / http / RequestBrokerTest.java
index 2892a1775dc667afd5deb76ed13e64d841d930ee..307fe90f93ba675d6d47fef394fd5ca94f31bd62 100644 (file)
@@ -189,7 +189,8 @@ public class RequestBrokerTest {
        
        @Test
        public void test_submitAndParse_throwsInvalidResultException() {
-               InvalidResponseException ire = new InvalidResponseException(GATEWAY, METHOD, new SAXParseException("dummy", null));
+               final String RESPONSE = "Must specify stop number.";
+               InvalidResponseException ire = new InvalidResponseException(new SAXParseException("dummy", null), GATEWAY, METHOD, RESPONSE);
                ArrayList<NameValuePair> emptyParams = new ArrayList<NameValuePair>();
                
                RequestBrokerMock rbm = new RequestBrokerMock(GATEWAY, emptyParams);
@@ -204,6 +205,7 @@ public class RequestBrokerTest {
                        Assert.assertEquals(ire, qde);
                        Assert.assertTrue(ire.toString().contains(GATEWAY));
                        Assert.assertTrue(ire.toString().contains(METHOD));
+                       Assert.assertTrue(ire.toString().contains(RESPONSE));
                }
        }
 }