/** * Negative test case for batch create contacts group scenario. * * @throws Exception */ @Test(priority = 1, groups = { "wso2.esb" }, description = "Google Contacts {batchCreateContactGroups} method {negative scenario} Integration Tests") public void testBatchCreateContactGroupsNegativeScenario() throws Exception { SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_batchCreateContactGroups_negative.xml"); final ContactGroupFeed directResponse = directInvoker.retrieveBatchContactGroupFeed("aaddd3324dd"); // Assert for the Error result. Assert.assertEquals( (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:entry[batch:id = 'retrieve']/atom:title/text())", nameSpaceMap), directResponse.getEntries().get(0).getTitle().getPlainText()); // Assert for the error response code. Assert.assertEquals( (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//batch:status/@code)", nameSpaceMap), Integer.toString(directResponse.getEntries().get(0).getBatchStatus().getCode())); }