@Test(priority = 2, groups = { "wso2.esb" }, dependsOnMethods = { "testCreateContactWithOptionalParameters" }, description = "Google Contacts {createContact} integration test with optional parameters.")
public void testUpdateContactWithOptionalParameters() throws Exception {
Map<String, String> parametersMap = new HashMap<String, String>();
parametersMap.put("contactId", contactId);
SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_updateContact_optional.xml", parametersMap);
String xPathExp = "string(//atom:id/text())";
String idUrl = (String) xPathEvaluate(esbSoapResponse, xPathExp, nameSpaceMap);
String updatedContactId = idUrl.substring(idUrl.lastIndexOf("/") + 1, idUrl.length());
Thread.sleep(Long.parseLong(connectorProperties.getProperty("timeDelay")));
ContactEntry directResponseObject = directInvoker.retrieveSingleContact(updatedContactId);
Assert.assertEquals(idUrl, directResponseObject.getId());
Assert.assertEquals((String) xPathEvaluate(esbSoapResponse, "string(//gd:phoneNumber/text())", nameSpaceMap), directResponseObject
.getPhoneNumbers().get(0).getPhoneNumber());
Assert.assertEquals((String) xPathEvaluate(esbSoapResponse, "string(//gd:email/@address)", nameSpaceMap), directResponseObject
.getEmailAddresses().get(0).getAddress());
}