Examples of UserWrapper


Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  }

  @Override
  public UserWrapper getOrCreate(String jiraUserName, Action<UserWrapper> postCreateAction)
  {
    UserWrapper userWrapper = get(jiraUserName);

    return userWrapper == null ? create(jiraUserName, postCreateAction) : userWrapper;
  }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Override
  public UserWrapper create(String jiraUserName, Action<UserWrapper> postCreateAction)
  {
    try
    {
      UserWrapper userWrapper = ao.create(UserWrapper.class, ImmutableMap.<String, Object>of("JIRA_USER_NAME", jiraUserName));
      if (postCreateAction != null)
      {
        postCreateAction.execute(userWrapper);
      }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  }

  @Override
  public void activate(User jiraUser, boolean active)
  {
    UserWrapper userWrapper = get(jiraUser);
    if (userWrapper != null)
    {
      userWrapper.setActive(active);
      userWrapper.save();
    }
  }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  }

  @Test
  public void getShouldReturnNullIfStatisticRefDoesntExist()
  {
    UserWrapper userWrapper = createUserWrapper();
    assertNull(daoService.get(userWrapper, "PKEY", StatisticRefEnum.CREATED_ISSUE_COUNT));
  }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Test
  public void createOrUpdateShouldCreateStatisticWithValueIfAny()
  {
    StatisticRefEnum statRef = StatisticRefEnum.CREATED_ISSUE_COUNT;
    createStatisticRef(statRef);
    UserWrapper userWrapper = createUserWrapper();

    int value = 1;
    String projectKey = "PKEY";
    daoService.createOrUpdate(userWrapper, projectKey, statRef, value);
    ProjectStatistic projectStatistic = daoService.get(userWrapper, projectKey, statRef);
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Test
  public void createOrUpdateShouldUpdateStatisticWithValueIfAny()
  {
    StatisticRefEnum statRef = StatisticRefEnum.CREATED_ISSUE_COUNT;
    createStatisticRef(statRef);
    UserWrapper userWrapper = createUserWrapper();

    int value = 2;
    String projectKey = "PKEY";
    daoService.createOrUpdate(userWrapper, projectKey, statRef, 1);
    daoService.createOrUpdate(userWrapper, projectKey, statRef, value);
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Test
  public void findShouldReturnStatisticsForProjectOrderedByDescendingValue() throws Exception
  {
    StatisticRefEnum statRef = StatisticRefEnum.CREATED_ISSUE_COUNT;
    createStatisticRef(statRef);
    UserWrapper bobUserWrapper = createUserWrapper("bob", "Sponge Bob");
    UserWrapper patrickUserWrapper = createUserWrapper("patrick", "Patrick Star");

    String projectKey = "PKEY";
    daoService.createOrUpdate(bobUserWrapper, projectKey, statRef, 1);
    daoService.createOrUpdate(patrickUserWrapper, projectKey, statRef, 5);
    entityManager.flushAll();
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Test
  public void createShouldCreateAndReturnUserWrapper() throws Exception
  {
    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    UserWrapper userWrapper = userWrapperDaoService.create(user);
    assertNotNull(userWrapper);
    entityManager.flushAll();

    UserWrapper newUserWrapper = userWrapperDaoService.get(name);
    assertNotNull(newUserWrapper);
    assertEquals(name, newUserWrapper.getJiraUserName());
  }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

  @Test
  public void shouldNotCreateTwoUserWrapperWithSameName()
  {
    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    UserWrapper firstUserWrapper = userWrapperDaoService.create(user);
    entityManager.flushAll();
   
    UserWrapper secondUserWrapper = userWrapperDaoService.create(user);
    entityManager.flushAll();
    assertEquals(firstUserWrapper.getID(), secondUserWrapper.getID());
  }
View Full Code Here

Examples of com.madgnome.jira.plugins.jirachievements.data.ao.UserWrapper

    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    userWrapperDaoService.create(user);
    entityManager.flushAll();

    UserWrapper userWrapper = userWrapperDaoService.get(name);
    assertNotNull(userWrapper);
    assertEquals(name, userWrapper.getJiraUserName());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.