Package fr.ippon.tatami.domain

Examples of fr.ippon.tatami.domain.User


        User validatedUser = userService.getUserByLogin(validatedLogin);
        assertNotNull(validatedUser);
    }

    private void mockAuthentication(String login) {
        User authenticateUser = constructAUser(login);
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(userService, "authenticationService", mockAuthenticationService);
    }
View Full Code Here


        Collection<StatusDTO> status = timelineService.getTagline(hashtag, 10, null, null);
        assertThatLineForUserWithStatusIsOk(username, status);
    }

    private void mockAuthenticationOnTimelineServiceWithACurrentUser(String login) {
        User authenticateUser = constructAUser(login);
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(timelineService, "authenticationService", mockAuthenticationService);
    }
View Full Code Here

    }

    public void deleteAvatar(String avatarId) {
        avatarRepository.removeAvatar(avatarId);

        User currentUser = authenticationService.getCurrentUser();
        userRepository.updateUser(currentUser);
    }
View Full Code Here

        TimelineController timelineController = new TimelineController();
        ReflectionTestUtils.setField(timelineController, "timelineService", timelineService);
        ReflectionTestUtils.setField(timelineController, "statusUpdateService", statusUpdateService);
        ReflectionTestUtils.setField(timelineController, "groupService", groupService);

        User authenticateUser = constructAUser(username + "@ippon.fr");
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(timelineController, "authenticationService", mockAuthenticationService);
        ReflectionTestUtils.setField(timelineService, "authenticationService", mockAuthenticationService);
        ReflectionTestUtils.setField(statusUpdateService, "authenticationService", mockAuthenticationService);
View Full Code Here

    public GroupService groupService;

    @Test
    public void createAndGetGroup() {
        mockAuthentication("uuser@ippon.fr");
        User user = userService.getUserByLogin("uuser@ippon.fr");
        String groupName = "Group name";
        String groupDescription = "Group description";
        boolean publicGroup = true;
        groupService.createGroup(groupName, groupDescription, publicGroup);
        Collection<Group> groups = groupService.getGroupsForUser(user);
View Full Code Here

        TagController tagController = new TagController();
        ReflectionTestUtils.setField(tagController, "timelineService", timelineService);
        ReflectionTestUtils.setField(tagController, "tagMembershipService", tagMembershipService);
        ReflectionTestUtils.setField(tagController, "userTagRepository", userTagRepository);

        User authenticateUser = constructAUser(username + "@ippon.fr");
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(tagController, "authenticationService", mockAuthenticationService);
        ReflectionTestUtils.setField(timelineService, "authenticationService", mockAuthenticationService);
        ReflectionTestUtils.setField(statusUpdateService, "authenticationService", mockAuthenticationService);
View Full Code Here

    @Test
    public void createGroup() {
        mockAuthentication("jdubois@ippon.fr");

        User user = userService.getUserByLogin("jdubois@ippon.fr");
        assertEquals(0, groupService.getGroupsForUser(user).size());

        String groupName = "Group name";
        String groupDescription = "Group description";
        boolean publicGroup = true;
View Full Code Here

    @Test
    public void addAndRemoveGroupMember() {
        mockAuthentication("userWithStatus@ippon.fr");

        User user = userService.getUserByLogin("userWithStatus@ippon.fr");
        assertEquals(0, groupService.getGroupsForUser(user).size());

        String groupName = "Group name";
        String groupDescription = "Group description";
        boolean publicGroup = true;
        groupService.createGroup(groupName, groupDescription, publicGroup);
        Collection<Group> groups = groupService.getGroupsForUser(user);
        assertEquals(1, groups.size());
        Group group = groups.iterator().next();
        String groupId = group.getGroupId();

        User member = userService.getUserByLogin("userWhoPostStatus@ippon.fr");

        assertEquals(1, groupService.getGroupsForUser(user).size());
        assertEquals(0, groupService.getGroupsForUser(member).size());

        Collection<UserGroupDTO> members = groupService.getMembersForGroup(groupId, user.getLogin());
View Full Code Here

        groupService.removeMemberFromGroup(user, group);
        assertEquals(0, groupService.getGroupsForUser(user).size());
    }

    private void mockAuthentication(String login) {
        User authenticateUser = constructAUser(login);
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(groupService, "authenticationService", mockAuthenticationService);
        ReflectionTestUtils.setField(userService, "authenticationService", mockAuthenticationService);
    }
View Full Code Here

        assertThat(userStat.getUsername(), is("userWithStatus"));
        assertThat(userStat.getStatusCount(), is(1L));
    }

    private void mockAuthenticationOnStatsServiceWithACurrentUser(String login) {
        User authenticateUser = constructAUser(login);
        AuthenticationService mockAuthenticationService = mock(AuthenticationService.class);
        when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser);
        ReflectionTestUtils.setField(statsService, "authenticationService", mockAuthenticationService);
    }
View Full Code Here

TOP

Related Classes of fr.ippon.tatami.domain.User

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.