@Before
  public final void startUp() throws Exception {
    this.handler = this.type.newInstance();
    this.request = new DataSourceRequest();
    this.request.setName(this.handler.getName());
    final UserEntity user = new UserEntity();
    user.setKey(new UserKey(User.ANONYMOUS_UID));
    user.setName(User.ANONYMOUS_UID);
    user.setDisplayName(User.ANONYMOUS_UID);
    this.request.setUser(user);
    this.request.setPreviewContext(PreviewContext.NO_PREVIEW);

    this.dummyDoc = XMLDocumentFactory.create("<dummy/>");
    this.dataSourceService = Mockito.mock(DataSourceService.class);

    initTest();
  }
Exemplo n.º 2
0
  public UserEntity createUser(
      String uid, String displayName, UserType type, String userStoreName, GroupEntity group) {
    UserEntity user = new UserEntity();
    user.setName(uid);
    user.setDisplayName(displayName);
    user.setSyncValue(uid);
    user.setTimestamp(new DateTime());
    user.setType(type);
    user.setDeleted(0);
    if (userStoreName != null) {
      user.setUserStore(fixture.findUserStoreByName(userStoreName));
    }
    if (group != null) {
      user.setUserGroup(group);
    }

    return user;
  }
Exemplo n.º 3
0
  public UserEntity createUserWithAllValues(
      String uid, String displayName, UserType type, String userStoreName, UserInfo userInfo) {
    UserEntity user = new UserEntity();
    user.setName(uid);
    user.setDisplayName(displayName);
    user.setSyncValue(uid);
    user.setTimestamp(new DateTime());
    user.setType(type);
    user.setDeleted(0);
    if (userStoreName != null) {
      user.setUserStore(fixture.findUserStoreByName(userStoreName));
    }
    user.setUserGroup(null);

    user.setUserFields(new UserInfoTransformer().toUserFields(userInfo));

    return user;
  }