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()));
customerManagement.suspendCustomer(customerId);
jsonEntity = customerManagement.getCustomerById(customerId);
Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
JsonJavaObject rootObject = jsonEntity.getJsonObject();
JsonJavaObject customerObject = rootObject.getAsObject("Customer");
System.out.println(customerObject);
Assert.assertNotNull("No SuspensionDate", customerObject.get("SuspensionDate"));
customerManagement.unsuspendCustomer(customerId);
jsonEntity = customerManagement.getCustomerById(customerId);
Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
rootObject = jsonEntity.getJsonObject();
customerObject = rootObject.getAsObject("Customer");
System.out.println(customerObject);
Assert.assertNull("SuspensionDate", customerObject.get("SuspensionDate"));
Assert.assertEquals("ACTIVE", customerObject.get("CustomerState"));