private PersonnelBO createPersonnel(OfficeBO office, PersonnelLevel personnelLevel)
      throws Exception {
    List<CustomFieldDto> customFieldDto = new ArrayList<CustomFieldDto>();
    customFieldDto.add(
        new CustomFieldDto(Short.valueOf("9"), "123456", CustomFieldType.NUMERIC.getValue()));
    Address address = new Address("abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd");
    Name name = new Name("XYZ", null, null, null);
    java.util.Date date = new java.util.Date();
    personnel =
        new PersonnelBO(
            personnelLevel,
            office,
            Integer.valueOf("1"),
            Short.valueOf("1"),
            "ABCD",
            "XYZ",
            "*****@*****.**",
            null,
            customFieldDto,
            name,
            "111111",
            date,
            Integer.valueOf("1"),
            Integer.valueOf("1"),
            date,
            date,
            address,
            userContext.getId());

    IntegrationTestObjectMother.createPersonnel(personnel);
    return IntegrationTestObjectMother.findPersonnelById(personnel.getPersonnelId());
  }
  @Test
  public void countOfCustomersInOfficeWithNoParent() {

    int count =
        customerDao.retrieveLastSearchIdValueForNonParentCustomersInOffice(
            IntegrationTestObjectMother.sampleBranchOffice().getOfficeId());

    assertThat(count, is(0));
  }
  @After
  public void tearDown() {
    this.testClient = null;
    this.testGroup = null;
    this.testCenter = null;
    this.weeklyMeeting = null;

    IntegrationTestObjectMother.cleanCustomerHierarchyWithMeeting(
        this.testClient, this.testGroup, this.testCenter, this.weeklyMeeting);
  }
  @Before
  public void setUp() throws CustomerException {
    this.clientPhotoService = new ClientPhotoServiceDatabase();
    this.clientPhotoService.setGenericDao(this.genericDao);
    this.clientPhotoService.setHibernateTransactionHelper(this.hibernateTransactionHelper);

    this.weeklyMeeting =
        new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    IntegrationTestObjectMother.saveMeeting(weeklyMeeting);

    this.testCenter =
        new CenterBuilder()
            .with(this.weeklyMeeting)
            .withName("Center Photo")
            .with(sampleBranchOffice())
            .withLoanOfficer(testUser())
            .build();
    IntegrationTestObjectMother.createCenter(this.testCenter, this.weeklyMeeting);

    this.testGroup =
        new GroupBuilder()
            .withMeeting(this.weeklyMeeting)
            .withName("Group Photo")
            .withOffice(sampleBranchOffice())
            .withLoanOfficer(testUser())
            .withParentCustomer(this.testCenter)
            .build();
    IntegrationTestObjectMother.createGroup(this.testGroup, this.weeklyMeeting);

    this.testClient =
        new ClientBuilder()
            .withMeeting(this.weeklyMeeting)
            .withName("Client 1")
            .withOffice(sampleBranchOffice())
            .withLoanOfficer(testUser())
            .withParentCustomer(this.testGroup)
            .buildForIntegrationTests();
    IntegrationTestObjectMother.createClient(this.testClient, this.weeklyMeeting);
  }