Examples of UserWrapper


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

  public void getOrCreateShouldCreateIfAny()
  {
    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    assertNull(userWrapperDaoService.get(user));
    UserWrapper userWrapper = userWrapperDaoService.getOrCreate(user);
    assertNotNull(userWrapper);
    entityManager.flushAll();

    assertNotNull(userWrapperDaoService.get(name));
  }
View Full Code Here

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

  @Test
  public void getOrCreateShouldReturnIfRefExists()
  {
    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    UserWrapper existingWrapper = userWrapperDaoService.create(user);

    UserWrapper userWrapper = userWrapperDaoService.getOrCreate(user);
    assertNotNull(userWrapper);
    assertEquals(existingWrapper, userWrapper);
  }
View Full Code Here

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

  public void getOrCreateShouldCreateFirstThenReturn()
  {
    String name = "bob";
    User user = new ImmutableUser(0, name, "Sponge Bob", null, true);
    assertNull(userWrapperDaoService.get(user));
    UserWrapper existingUserWrapper = userWrapperDaoService.getOrCreate(user);
    assertNotNull(existingUserWrapper);

    UserWrapper userWrapper = userWrapperDaoService.getOrCreate(user);
    assertNotNull(userWrapper);
    assertEquals(existingUserWrapper, userWrapper);
  }
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", "1.0", 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;
    final String projectKey = "PKEY";
    final String version = "1.0";
    daoService.createOrUpdate(userWrapper, projectKey, version, statRef, value);
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;
    final String projectKey = "PKEY";
    final String version = "1.0";
    daoService.createOrUpdate(userWrapper, projectKey, version, statRef, 1);
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");

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

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

  }

  @Test
  public void getUserNewAchievementsShouldReturnsNewAchivement()
  {
    UserWrapper userWrapper = userWrapperDaoService.create("user", null);
    final Achievement achievement = referencableDaoService.create("Achivement1");
    userAchievementDaoService.addAchievementToUser(achievement, userWrapper);

    final List<Achievement> newAchievements = referencableDaoService.getUserNewAchievements(userWrapper);
    final UserAchievement userAchievement = userAchievementDaoService.get(newAchievements.get(0), userWrapper);
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, StatisticRefEnum.CREATED_ISSUE_COUNT));
  }
View Full Code Here

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

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

    UserStatistic userStatistic = daoService.get(userWrapper, statRef);
    assertNotNull(userStatistic);
    assertEquals(0, userStatistic.getValue());
  }
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.