final String firstName = "Karani";
    defaultName.setFirstName(firstName);
    entity.getNames().add(defaultName);
    when(entityInfoSvc.getEntityByEmail(emailFromOpenId)).thenReturn(entity);
    // prepare the entity email to be found and so that the mock entity can be returned
    EntityEmailBo emailBo = new EntityEmailBo();
    final String entityId = "entity1";
    emailBo.setEntityId(entityId);
    List<EntityEmailBo> result = new ArrayList<EntityEmailBo>();
    result.add(emailBo);
    when(boSvc.findMatching(same(EntityEmailBo.class), anyMapOf(String.class, String.class))).thenReturn(result);
    
    // test that only active users with staff affiliation can log in