Java Code Examples for org.wso2.carbon.automation.test.utils.http.client.HttpResponse#getResponseCode()
The following examples show how to use
org.wso2.carbon.automation.test.utils.http.client.HttpResponse#getResponseCode() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify all query params return expected response for given resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithParameters() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 2
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * * Resource - /pattern3/* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern3WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern3/sample?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20&floor</m:longitude><m:floor/></m:checkQueryParam>", "Query Parameter isn't evaluated according the standard"); }
Example 3
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * * Resource - /pattern3/* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern3WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern3/sample?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }
Example 4
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * * Resource - /pattern2* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern2WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern2?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20&floor</m:longitude><m:floor/></m:checkQueryParam>", "Query Parameter isn't evaluated according the standard"); }
Example 5
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * * Resource - /pattern2* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern2WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern2?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }
Example 6
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 404); }
Example 7
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify all query params empty return expected response for given resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithAllParametersEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=&longitude=&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude/><m:longitude/><m:floor/></m:checkQueryParam>"); }
Example 8
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify second query param empty return expected response for given resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithSecondtParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude/><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 9
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify first query param empty return expected response for given resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithFirstParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=&longitude=20&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude/><m:longitude>20</m:longitude><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 10
Source File: LastQueryParamEmptyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }
Example 11
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify all query params return expected response for given resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithParameters() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 12
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * <p> * Resource - /pattern3/* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern3WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern3/sample?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20&floor</m:longitude><m:floor/></m:checkQueryParam>", "Query Parameter isn't evaluated according the standard"); }
Example 13
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * <p> * Resource - /pattern3/* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern3WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil.sendGetRequest( getApiInvocationURL("last-query-param-empty/pattern3/sample?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }
Example 14
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * <p> * Resource - /pattern2* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern2WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern2?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20&floor</m:longitude><m:floor/></m:checkQueryParam>", "Query Parameter isn't evaluated according the standard"); }
Example 15
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * <p> * Resource - /pattern2* * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern2WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern2?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }
Example 16
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty and missing equal sign return expected response for given * resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithLastParameterEmptyAndMissingEqualSign() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 404); }
Example 17
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify all query params empty return expected response for given resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithAllParametersEmpty() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern1?latitude=&longitude=&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude/><m:longitude/><m:floor/></m:checkQueryParam>"); }
Example 18
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify second query param empty return expected response for given resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithSecondtParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude/><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 19
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify first query param empty return expected response for given resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithFirstParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern1?latitude=&longitude=20&floor=30"), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude/><m:longitude>20</m:longitude><m:floor>30</m:floor></m:checkQueryParam>"); }
Example 20
Source File: LastQueryParamEmptyTestCase.java From micro-integrator with Apache License 2.0 | 5 votes |
/** * This test method verify last query param empty return expected response for given resource template * <p> * Resource - /pattern1?latitude={+latitude}&longitude={+longitude}&floor={+floor} * * @throws Exception */ @Test(groups = { "wso2.esb" }) public void testResourcePattern1WithLastParameterEmpty() throws Exception { HttpResponse response = HttpRequestUtil .sendGetRequest(getApiInvocationURL("last-query-param-empty/pattern1?latitude=10&longitude=20&floor="), null); Assert.assertNotNull(response); int responseCode = response.getResponseCode(); String responseData = response.getData(); Assert.assertEquals(responseCode, 200); Assert.assertEquals(responseData, "<m:checkQueryParam xmlns:m=\"http://services.samples/xsd\">" + "<m:latitude>10</m:latitude><m:longitude>20</m:longitude><m:floor/></m:checkQueryParam>"); }