try {
String customerId = registerCustomer();
CustomerManagementService customerManagement = getCustomerManagementService();
JsonEntity jsonEntity = customerManagement.getCustomerById(customerId);
Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
Assert.assertEquals(customerId, customerManagement.getCustomerId(jsonEntity.getJsonObject()));
JsonJavaObject rootObject = jsonEntity.getJsonObject();
Assert.assertNotNull("Unable to retrieve customer: "+customerId, rootObject);
System.out.println(rootObject);
JsonJavaObject customerObject = rootObject.getAsObject("Customer");
JsonJavaObject organizationObject = customerObject.getAsObject("Organization");
organizationObject.putString("Phone", "888-888-8888");
JsonJavaObject contactObject = organizationObject.getAsObject("Contact");
contactObject.putString("WorkPhone", "800-666-1234");
customerManagement.updateCustomerProfile(rootObject);
jsonEntity = customerManagement.getCustomerById(customerId);
Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
Assert.assertEquals(customerId, customerManagement.getCustomerId(jsonEntity.getJsonObject()));
rootObject = jsonEntity.getJsonObject();
Assert.assertNotNull("Unable to retrieve customer: "+customerId, customerObject);
System.out.println(rootObject);
customerObject = rootObject.getAsObject("Customer");
organizationObject = customerObject.getAsObject("Organization");