fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From my...@apache.org
Subject [fineract-cn-office] 02/14: renamed API class
Date Mon, 22 Jan 2018 15:24:00 GMT
This is an automated email from the ASF dual-hosted git repository.

myrle pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-office.git

commit 102fb07f48dc6974e91db0d74048d1956c629046
Author: Markus Geiss <mgeiss@mifos.org>
AuthorDate: Fri Mar 17 17:58:10 2017 +0100

    renamed API class
---
 ...{OfficeClient.java => OrganizationManager.java} |  2 +-
 .../main/java/io/mifos/office/TestEmployee.java    | 88 +++++++++++-----------
 .../src/main/java/io/mifos/office/TestOffice.java  | 72 +++++++++---------
 3 files changed, 81 insertions(+), 81 deletions(-)

diff --git a/api/src/main/java/io/mifos/office/api/v1/client/OfficeClient.java b/api/src/main/java/io/mifos/office/api/v1/client/OrganizationManager.java
similarity index 99%
rename from api/src/main/java/io/mifos/office/api/v1/client/OfficeClient.java
rename to api/src/main/java/io/mifos/office/api/v1/client/OrganizationManager.java
index 195ccfd..3ef36b2 100644
--- a/api/src/main/java/io/mifos/office/api/v1/client/OfficeClient.java
+++ b/api/src/main/java/io/mifos/office/api/v1/client/OrganizationManager.java
@@ -37,7 +37,7 @@ import java.util.List;
 
 @SuppressWarnings("unused")
 @FeignClient(name="office-v1", path="/office/v1", configuration=CustomFeignClientsConfiguration.class)
-public interface OfficeClient {
+public interface OrganizationManager {
 
   @RequestMapping(
       value = "/offices",
diff --git a/component-test/src/main/java/io/mifos/office/TestEmployee.java b/component-test/src/main/java/io/mifos/office/TestEmployee.java
index 9914c77..a826e39 100644
--- a/component-test/src/main/java/io/mifos/office/TestEmployee.java
+++ b/component-test/src/main/java/io/mifos/office/TestEmployee.java
@@ -26,7 +26,7 @@ import io.mifos.core.test.listener.EventRecorder;
 import io.mifos.office.api.v1.EventConstants;
 import io.mifos.office.api.v1.client.AlreadyExistsException;
 import io.mifos.office.api.v1.client.BadRequestException;
-import io.mifos.office.api.v1.client.OfficeClient;
+import io.mifos.office.api.v1.client.OrganizationManager;
 import io.mifos.office.api.v1.client.NotFoundException;
 import io.mifos.office.api.v1.domain.ContactDetail;
 import io.mifos.office.api.v1.domain.Employee;
@@ -79,7 +79,7 @@ public class TestEmployee {
           = new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize);
 
   @Autowired
-  private OfficeClient officeClient;
+  private OrganizationManager organizationManager;
 
   @Autowired
   private EventRecorder eventRecorder;
@@ -108,12 +108,12 @@ public class TestEmployee {
   public void shouldCreateEmployee() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
     {
-      this.officeClient.createEmployee(employee);
+      this.organizationManager.createEmployee(employee);
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
-    final Employee savedEmployee = this.officeClient.findEmployee(employee.getIdentifier());
+    final Employee savedEmployee = this.organizationManager.findEmployee(employee.getIdentifier());
 
     Assert.assertNotNull(savedEmployee);
     Assert.assertEquals(employee.getIdentifier(), savedEmployee.getIdentifier());
@@ -121,41 +121,41 @@ public class TestEmployee {
     Assert.assertEquals(employee.getMiddleName(), savedEmployee.getMiddleName());
     Assert.assertEquals(employee.getSurname(), savedEmployee.getSurname());
 
-    this.officeClient.deleteEmployee(employee.getIdentifier());
+    this.organizationManager.deleteEmployee(employee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
   }
 
   @Test
   public void shouldNotCreateEmployeeAlreadyExists() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
 
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     try {
-      this.officeClient.createEmployee(employee);
+      this.organizationManager.createEmployee(employee);
       Assert.fail();
     } catch (final AlreadyExistsException ex) {
       // do nothing, expected
     }
 
-    this.officeClient.deleteEmployee(employee.getIdentifier());
+    this.organizationManager.deleteEmployee(employee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
   }
 
   @Test
   public void shouldFindEmployeesByOffice() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final Employee employee = EmployeeFactory.createRandomEmployee();
     employee.setAssignedOffice(office.getIdentifier());
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
 
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
-    final EmployeePage employeePage = this.officeClient.fetchEmployees(null, office.getIdentifier(),
0, 20, null, null);
+    final EmployeePage employeePage = this.organizationManager.fetchEmployees(null, office.getIdentifier(),
0, 20, null, null);
     Assert.assertEquals(Long.valueOf(1L), employeePage.getTotalElements());
     final Employee savedEmployee = employeePage.getEmployees().get(0);
     Assert.assertEquals(employee.getIdentifier(), savedEmployee.getIdentifier());
@@ -163,45 +163,45 @@ public class TestEmployee {
     Assert.assertEquals(employee.getMiddleName(), savedEmployee.getMiddleName());
     Assert.assertEquals(employee.getSurname(), savedEmployee.getSurname());
 
-    this.officeClient.deleteEmployee(employee.getIdentifier());
+    this.organizationManager.deleteEmployee(employee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldFindAllEmployees() throws Exception {
     final Employee firstEmployee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(firstEmployee);
+    this.organizationManager.createEmployee(firstEmployee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, firstEmployee.getIdentifier());
     final Employee secondEmployee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(secondEmployee);
+    this.organizationManager.createEmployee(secondEmployee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, secondEmployee.getIdentifier());
 
-    final EmployeePage employeePage = this.officeClient.fetchEmployees(null, null, 0, 20,
null, null);
+    final EmployeePage employeePage = this.organizationManager.fetchEmployees(null, null,
0, 20, null, null);
     Assert.assertEquals(Long.valueOf(2L), employeePage.getTotalElements());
 
-    this.officeClient.deleteEmployee(firstEmployee.getIdentifier());
+    this.organizationManager.deleteEmployee(firstEmployee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, firstEmployee.getIdentifier());
-    this.officeClient.deleteEmployee(secondEmployee.getIdentifier());
+    this.organizationManager.deleteEmployee(secondEmployee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, secondEmployee.getIdentifier());
   }
 
   @Test
   public void shouldDeleteEmployee() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
-    Assert.assertNotNull(this.officeClient.findEmployee(employee.getIdentifier()));
+    Assert.assertNotNull(this.organizationManager.findEmployee(employee.getIdentifier()));
 
     {
-      this.officeClient.deleteEmployee(employee.getIdentifier());
+      this.organizationManager.deleteEmployee(employee.getIdentifier());
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
     try {
-      this.officeClient.findEmployee(employee.getIdentifier());
+      this.organizationManager.findEmployee(employee.getIdentifier());
       Assert.fail();
     } catch (final NotFoundException ex) {
       // do nothing, expected
@@ -211,11 +211,11 @@ public class TestEmployee {
   @Test
   public void shouldUpdateEmployee() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final Employee updatedEmployee = EmployeeFactory.createRandomEmployee();
@@ -223,12 +223,12 @@ public class TestEmployee {
     updatedEmployee.setAssignedOffice(office.getIdentifier());
 
     {
-      this.officeClient.updateEmployee(employee.getIdentifier(), updatedEmployee);
+      this.organizationManager.updateEmployee(employee.getIdentifier(), updatedEmployee);
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_PUT_EMPLOYEE,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
-    final Employee savedEmployee = this.officeClient.findEmployee(employee.getIdentifier());
+    final Employee savedEmployee = this.organizationManager.findEmployee(employee.getIdentifier());
     Assert.assertNotNull(savedEmployee);
     Assert.assertEquals(updatedEmployee.getIdentifier(), savedEmployee.getIdentifier());
     Assert.assertEquals(updatedEmployee.getGivenName(), savedEmployee.getGivenName());
@@ -237,7 +237,7 @@ public class TestEmployee {
     Assert.assertEquals(updatedEmployee.getAssignedOffice(), savedEmployee.getAssignedOffice());
 
     {
-      this.officeClient.deleteEmployee(employee.getIdentifier());
+      this.organizationManager.deleteEmployee(employee.getIdentifier());
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
@@ -246,44 +246,44 @@ public class TestEmployee {
   @Test
   public void shouldNotUpdateEmployeeCodeMismatch() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     final String originalCode = employee.getIdentifier();
     employee.setIdentifier(RandomStringUtils.randomAlphanumeric(8));
 
     try {
-      this.officeClient.updateEmployee(originalCode, employee);
+      this.organizationManager.updateEmployee(originalCode, employee);
       Assert.fail();
     } catch (final BadRequestException ex) {
       // do nothing, expected
     }
 
-    this.officeClient.deleteEmployee(originalCode);
+    this.organizationManager.deleteEmployee(originalCode);
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, originalCode);
   }
 
   @Test
   public void shouldNotUpdateEmployeeNotFound() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     try {
-      this.officeClient.updateEmployee(RandomStringUtils.randomAlphanumeric(8), employee);
+      this.organizationManager.updateEmployee(RandomStringUtils.randomAlphanumeric(8), employee);
       Assert.fail();
     } catch (final NotFoundException ex) {
       // do nothing, expected
     }
 
-    this.officeClient.deleteEmployee(employee.getIdentifier());
+    this.organizationManager.deleteEmployee(employee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
   }
 
   @Test
   public void shouldSetContactDetailOfEmployee() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     final ContactDetail email = new ContactDetail();
@@ -299,12 +299,12 @@ public class TestEmployee {
     phone.setPreferenceLevel(2);
 
     {
-      this.officeClient.setContactDetails(employee.getIdentifier(), Arrays.asList(email,
phone));
+      this.organizationManager.setContactDetails(employee.getIdentifier(), Arrays.asList(email,
phone));
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_PUT_CONTACT_DETAIL,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
-    final List<ContactDetail> savedContactDetails = this.officeClient.fetchContactDetails(employee.getIdentifier());
+    final List<ContactDetail> savedContactDetails = this.organizationManager.fetchContactDetails(employee.getIdentifier());
     Assert.assertNotNull(savedContactDetails);
     Assert.assertEquals(2, savedContactDetails.size());
 
@@ -321,7 +321,7 @@ public class TestEmployee {
     Assert.assertEquals(phone.getPreferenceLevel(), savedPhone.getPreferenceLevel());
 
     {
-      this.officeClient.deleteEmployee(employee.getIdentifier());
+      this.organizationManager.deleteEmployee(employee.getIdentifier());
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
@@ -335,7 +335,7 @@ public class TestEmployee {
     contactDetail.setValue("employee@example.com");
 
     try {
-      this.officeClient.setContactDetails(RandomStringUtils.randomAlphanumeric(8), Collections.singletonList(contactDetail));
+      this.organizationManager.setContactDetails(RandomStringUtils.randomAlphanumeric(8),
Collections.singletonList(contactDetail));
       Assert.fail();
     } catch (final NotFoundException ex) {
       // do nothing, expected
@@ -345,7 +345,7 @@ public class TestEmployee {
   @Test
   public void shouldDeleteContactDetailOfEmployee() throws Exception {
     final Employee employee = EmployeeFactory.createRandomEmployee();
-    this.officeClient.createEmployee(employee);
+    this.organizationManager.createEmployee(employee);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
 
     final ContactDetail email = new ContactDetail();
@@ -361,22 +361,22 @@ public class TestEmployee {
     phone.setPreferenceLevel(2);
 
     {
-      this.officeClient.setContactDetails(employee.getIdentifier(), Arrays.asList(email,
phone));
+      this.organizationManager.setContactDetails(employee.getIdentifier(), Arrays.asList(email,
phone));
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_PUT_CONTACT_DETAIL,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
-    Assert.assertNotNull(this.officeClient.fetchContactDetails(employee.getIdentifier()));
+    Assert.assertNotNull(this.organizationManager.fetchContactDetails(employee.getIdentifier()));
 
     {
-      this.officeClient.deleteContactDetails(employee.getIdentifier());
+      this.organizationManager.deleteContactDetails(employee.getIdentifier());
       final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_DELETE_CONTACT_DETAIL,
employee.getIdentifier());
       Assert.assertTrue(found);
     }
 
-    Assert.assertTrue(this.officeClient.fetchContactDetails(employee.getIdentifier()).isEmpty());
+    Assert.assertTrue(this.organizationManager.fetchContactDetails(employee.getIdentifier()).isEmpty());
 
-    this.officeClient.deleteEmployee(employee.getIdentifier());
+    this.organizationManager.deleteEmployee(employee.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
   }
 
diff --git a/component-test/src/main/java/io/mifos/office/TestOffice.java b/component-test/src/main/java/io/mifos/office/TestOffice.java
index 9a1bd26..c28d48d 100644
--- a/component-test/src/main/java/io/mifos/office/TestOffice.java
+++ b/component-test/src/main/java/io/mifos/office/TestOffice.java
@@ -26,7 +26,7 @@ import io.mifos.core.test.listener.EventRecorder;
 import io.mifos.office.api.v1.EventConstants;
 import io.mifos.office.api.v1.client.AlreadyExistsException;
 import io.mifos.office.api.v1.client.BadRequestException;
-import io.mifos.office.api.v1.client.OfficeClient;
+import io.mifos.office.api.v1.client.OrganizationManager;
 import io.mifos.office.api.v1.client.NotFoundException;
 import io.mifos.office.api.v1.domain.Address;
 import io.mifos.office.api.v1.domain.Office;
@@ -74,7 +74,7 @@ public class TestOffice {
           = new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize);
 
   @Autowired
-  private OfficeClient officeClient;
+  private OrganizationManager organizationManager;
 
   @Autowired
   private EventRecorder eventRecorder;
@@ -102,92 +102,92 @@ public class TestOffice {
   @Test
   public void shouldCreateOffice() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
-    final Office savedOffice = this.officeClient.findOfficeByIdentifier(office.getIdentifier());
+    final Office savedOffice = this.organizationManager.findOfficeByIdentifier(office.getIdentifier());
     Assert.assertNotNull(savedOffice);
     Assert.assertEquals(office.getIdentifier(), savedOffice.getIdentifier());
     Assert.assertEquals(office.getName(), savedOffice.getName());
     Assert.assertEquals(office.getDescription(), savedOffice.getDescription());
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldNotCreateOfficeDuplicate() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
     try {
-      this.officeClient.createOffice(office);
+      this.organizationManager.createOffice(office);
       Assert.fail();
     } catch (final AlreadyExistsException ex) {
       // do nothing, expected
     }
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldUpdateOffice() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final String modifiedOfficeName = RandomStringUtils.randomAlphanumeric(32);
     office.setName(modifiedOfficeName);
 
-    this.officeClient.updateOffice(office.getIdentifier(), office);
+    this.organizationManager.updateOffice(office.getIdentifier(), office);
     this.eventRecorder.wait(EventConstants.OPERATION_PUT_OFFICE, office.getIdentifier());
 
-    final Office changedOffice = this.officeClient.findOfficeByIdentifier(office.getIdentifier());
+    final Office changedOffice = this.organizationManager.findOfficeByIdentifier(office.getIdentifier());
     Assert.assertEquals(modifiedOfficeName, changedOffice.getName());
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldNotUpdateOfficeIdentifierMismatch() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final String originalIdentifier = office.getIdentifier();
     office.setIdentifier(RandomStringUtils.randomAlphanumeric(32));
 
     try {
-      this.officeClient.updateOffice(originalIdentifier, office);
+      this.organizationManager.updateOffice(originalIdentifier, office);
       Assert.fail();
     } catch (final BadRequestException ex) {
       // do nothing, expected
     }
-    this.officeClient.deleteOffice(originalIdentifier);
+    this.organizationManager.deleteOffice(originalIdentifier);
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldAddBranch() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final Office branch = OfficeFactory.createRandomOffice();
-    this.officeClient.addBranch(office.getIdentifier(), branch);
+    this.organizationManager.addBranch(office.getIdentifier(), branch);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, branch.getIdentifier());
 
-    final OfficePage officePage = this.officeClient.getBranches(office.getIdentifier(), 0,
10, null, null);
+    final OfficePage officePage = this.organizationManager.getBranches(office.getIdentifier(),
0, 10, null, null);
     Assert.assertEquals(Long.valueOf(1L), officePage.getTotalElements());
 
     final Office savedBranch = officePage.getOffices().get(0);
     Assert.assertEquals(branch.getIdentifier(), savedBranch.getIdentifier());
 
-    this.officeClient.deleteOffice(branch.getIdentifier());
+    this.organizationManager.deleteOffice(branch.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, branch.getIdentifier());
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
@@ -195,7 +195,7 @@ public class TestOffice {
   public void shouldNotAddBranchParentNotFound() throws Exception {
     try {
       final Office branch = OfficeFactory.createRandomOffice();
-      this.officeClient.addBranch(RandomStringUtils.randomAlphanumeric(32), branch);
+      this.organizationManager.addBranch(RandomStringUtils.randomAlphanumeric(32), branch);
       Assert.fail();
     } catch (final NotFoundException ex) {
       // do nothing, expected
@@ -205,14 +205,14 @@ public class TestOffice {
   @Test
   public void shouldSetAddressOfOffice() throws Exception {
     final Office office = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
     final Address address = AddressFactory.createRandomAddress();
-    this.officeClient.setAddressForOffice(office.getIdentifier(), address);
+    this.organizationManager.setAddressForOffice(office.getIdentifier(), address);
     this.eventRecorder.wait(EventConstants.OPERATION_PUT_ADDRESS, office.getIdentifier());
 
-    final Address savedAddress = this.officeClient.getAddressOfOffice(office.getIdentifier());
+    final Address savedAddress = this.organizationManager.getAddressOfOffice(office.getIdentifier());
     Assert.assertNotNull(savedAddress);
     Assert.assertEquals(address.getStreet(), savedAddress.getStreet());
     Assert.assertEquals(address.getCity(), savedAddress.getCity());
@@ -221,7 +221,7 @@ public class TestOffice {
     Assert.assertEquals(address.getCountryCode(), savedAddress.getCountryCode());
     Assert.assertEquals(address.getCountry(), savedAddress.getCountry());
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
@@ -230,10 +230,10 @@ public class TestOffice {
     final Office office = OfficeFactory.createRandomOffice();
     final Address address = AddressFactory.createRandomAddress();
     office.setAddress(address);
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
-    final Address savedAddress = this.officeClient.getAddressOfOffice(office.getIdentifier());
+    final Address savedAddress = this.organizationManager.getAddressOfOffice(office.getIdentifier());
     Assert.assertNotNull(savedAddress);
     Assert.assertEquals(address.getStreet(), savedAddress.getStreet());
     Assert.assertEquals(address.getCity(), savedAddress.getCity());
@@ -242,7 +242,7 @@ public class TestOffice {
     Assert.assertEquals(address.getCountryCode(), savedAddress.getCountryCode());
     Assert.assertEquals(address.getCountry(), savedAddress.getCountry());
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
@@ -251,32 +251,32 @@ public class TestOffice {
     final Office office = OfficeFactory.createRandomOffice();
     final Address address = AddressFactory.createRandomAddress();
     office.setAddress(address);
-    this.officeClient.createOffice(office);
+    this.organizationManager.createOffice(office);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
 
-    final Address savedAddress = this.officeClient.getAddressOfOffice(office.getIdentifier());
+    final Address savedAddress = this.organizationManager.getAddressOfOffice(office.getIdentifier());
     Assert.assertNotNull(savedAddress);
 
-    this.officeClient.deleteAddressOfOffice(office.getIdentifier());
+    this.organizationManager.deleteAddressOfOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_ADDRESS, office.getIdentifier());
 
-    Assert.assertNull(this.officeClient.getAddressOfOffice(office.getIdentifier()));
+    Assert.assertNull(this.organizationManager.getAddressOfOffice(office.getIdentifier()));
 
-    this.officeClient.deleteOffice(office.getIdentifier());
+    this.organizationManager.deleteOffice(office.getIdentifier());
     this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
   }
 
   @Test
   public void shouldReturnParentOfBranch() throws Exception {
     final Office parent = OfficeFactory.createRandomOffice();
-    this.officeClient.createOffice(parent);
+    this.organizationManager.createOffice(parent);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, parent.getIdentifier());
 
     final Office branch = OfficeFactory.createRandomOffice();
-    this.officeClient.addBranch(parent.getIdentifier(), branch);
+    this.organizationManager.addBranch(parent.getIdentifier(), branch);
     this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, branch.getIdentifier());
 
-    final Office savedBranch = this.officeClient.findOfficeByIdentifier(branch.getIdentifier());
+    final Office savedBranch = this.organizationManager.findOfficeByIdentifier(branch.getIdentifier());
 
     Assert.assertEquals(parent.getIdentifier(), savedBranch.getParentIdentifier());
   }

-- 
To stop receiving notification emails like this one, please contact
myrle@apache.org.

Mime
View raw message