@Test public void testIsAdmin() throws Exception { long userId = 1; boolean isAdmin = teamService.isAdmin(userId); Assert.assertEquals(true, isAdmin); }
public boolean isAdmin(long userId) throws ShepherException { Team team = teamBiz.getByName(ShepherConstants.ADMIN); return userTeamBiz.getRoleValue(userId, team.getId(), Status.AGREE) > ShepherConstants.DEFAULT_ROLEVALUE; }
TeamService { public boolean isAdmin(long userId) throws ShepherException { Team team = teamBiz.getByName(ShepherConstants.ADMIN); return userTeamBiz.getRoleValue(userId, team.getId(), Status.AGREE) > ShepherConstants.DEFAULT_ROLEVALUE; } }
TeamService { public boolean isAdmin(long userId) throws ShepherException { Team team = teamBiz.getByName(ShepherConstants.ADMIN); return userTeamBiz.getRoleValue(userId, team.getId(), Status.AGREE) > ShepherConstants.DEFAULT_ROLEVALUE; }  }
TeamService { public boolean isAdmin(long userId) throws ShepherException { Team team = teamBiz.getByName(ShepherConstants.ADMIN); return userTeamBiz.getRoleValue(userId, team.getId(), Status.AGREE) > ShepherConstants.DEFAULT_ROLEVALUE; }  @Transactional boolean create(long userId, String teamName, String cluster, String path); UserTeam addApply(long userId, long teamId, Role role); @Transactional void addApply(User user, long teamId, Role role); @Transactional void addMember(User member, long teamId, Role role, User creator); List<UserTeam> listUserTeamsPending(Team team); List<UserTeam> listUserTeamsAgree(Team team); List<UserTeam> listUserTeamsJoined(User user); List<Team> listTeamsToJoin(long userId, String cluster, String path); List<Team> listTeamsJoined(long userId, String cluster, String path); Team get(String teamName); Team get(long teamId); int updateStatus(long id, Status status); int agreeJoin(User user, long id, long teamId); int refuseJoin(User user, long id, long teamId); int updateRole(long id, Role role); boolean hasApplied(long teamId, String cluster, String path); boolean isMaster(long userId, long teamId); boolean isOwner(long userId, long teamId); boolean isAdmin(long userId); }
TeamService { public boolean isAdmin(long userId) throws ShepherException { Team team = teamBiz.getByName(ShepherConstants.ADMIN); return userTeamBiz.getRoleValue(userId, team.getId(), Status.AGREE) > ShepherConstants.DEFAULT_ROLEVALUE; }  @Transactional boolean create(long userId, String teamName, String cluster, String path); UserTeam addApply(long userId, long teamId, Role role); @Transactional void addApply(User user, long teamId, Role role); @Transactional void addMember(User member, long teamId, Role role, User creator); List<UserTeam> listUserTeamsPending(Team team); List<UserTeam> listUserTeamsAgree(Team team); List<UserTeam> listUserTeamsJoined(User user); List<Team> listTeamsToJoin(long userId, String cluster, String path); List<Team> listTeamsJoined(long userId, String cluster, String path); Team get(String teamName); Team get(long teamId); int updateStatus(long id, Status status); int agreeJoin(User user, long id, long teamId); int refuseJoin(User user, long id, long teamId); int updateRole(long id, Role role); boolean hasApplied(long teamId, String cluster, String path); boolean isMaster(long userId, long teamId); boolean isOwner(long userId, long teamId); boolean isAdmin(long userId);  }