Package com.madgnome.jira.plugins.jirachievements.data.services

Examples of com.madgnome.jira.plugins.jirachievements.data.services.IUserLevelDaoService


    UserStatistic createdUserStatistic = mock(UserStatistic.class);
    when(createdUserStatistic.getValue()).thenReturn(10);
    when(userStatisticDaoService.get(any(UserWrapper.class), any(StatisticRefEnum.class))).thenReturn(createdUserStatistic);

    IUserWrapperDaoService userWrapperDaoService = mock(IUserWrapperDaoService.class);
    IUserLevelDaoService userLevelDaoService = mock(IUserLevelDaoService.class);

    ILevelDaoService levelDaoService = mock(ILevelDaoService.class);
    Level level = mock(Level.class);
    when(levelDaoService.findMatchingLevel(any(Category.class), anyInt())).thenReturn(level);
View Full Code Here


    UserStatistic createdUserStatistic = mock(UserStatistic.class);
    when(createdUserStatistic.getValue()).thenReturn(10);
    when(userStatisticDaoService.get(any(UserWrapper.class), any(StatisticRefEnum.class))).thenReturn(createdUserStatistic);

    IUserWrapperDaoService userWrapperDaoService = mock(IUserWrapperDaoService.class);
    IUserLevelDaoService userLevelDaoService = mock(IUserLevelDaoService.class);

    ILevelDaoService levelDaoService = mock(ILevelDaoService.class);
    Level level = mock(Level.class);
    when(levelDaoService.findMatchingLevel(any(Category.class), anyInt())).thenReturn(level);

    LevelManager levelManager = new LevelManager(userStatisticDaoService, userWrapperDaoService, userLevelDaoService, levelDaoService);

    UserWrapper userWrapper = mock(UserWrapper.class);
    levelManager.checkLevels(userWrapper);
    when(userLevelDaoService.last(any(UserWrapper.class), any(Category.class))).thenReturn(level);

    levelManager.checkLevels(userWrapper);

    verify(userLevelDaoService, times(3)).addLevelToUser(any(Level.class), any(UserWrapper.class));
  }
View Full Code Here

TOP

Related Classes of com.madgnome.jira.plugins.jirachievements.data.services.IUserLevelDaoService

Copyright © 2018 www.massapicom. 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.