Package com.infoclinika.mssharing.model.internal.repository

Examples of com.infoclinika.mssharing.model.internal.repository.UserLabMembershipRequestRepository.findPendingByUser()


        final long john = uc.createJohnWithoutLab();
        UserLabMembershipRequestRepository repo = getUserLabMemebershipRequestRepository();

        uc.requestJohnLab3Membership();
        assertEquals(repo.findPendingByUser(john).size(), 1);
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, null);
        fail("Exception was expected");
    }

    @Test
View Full Code Here


    public void testCheckRequest(){
        uc.createPaul();
        final long john = uc.createJohnWithoutLab();
        uc.requestJohnLab3Membership();
        UserLabMembershipRequestRepository repo = getUserLabMemebershipRequestRepository();
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.checkRequest(requestId);
    }

    @Test
    public void testUpdatePersonAndSendEmail() throws URISyntaxException {
View Full Code Here

    public void testUpdatePersonAndSendEmail() throws URISyntaxException {
        long labHead = uc.createPaul();                             //create lab3 & Paul - lab3's head
        final long john = uc.createJohnWithoutLab();                // crate john - the user with no lab

        UserLabMembershipRequestRepository repo = getUserLabMemebershipRequestRepository();
        assertEquals(repo.findPendingByUser(john).size(), 0);       //no requests

        final String approveUrl = "testUrl";
        UserManagement.LabMembershipConfirmationUrlProvider urlProvider = new UserManagement.LabMembershipConfirmationUrlProvider() {
            @Override
            public String getUrl(long user, long lab, long requestId, UserManagement.LabMembershipRequestActions action) throws URISyntaxException {
View Full Code Here

        userManagement.updatePersonAndSendEmail(john, new UserManagement.PersonInfo("Joe", "J", "jjj@j.com"), ImmutableSet.of(uc.getLab3()), urlProvider);
        Notifier notifier = notificator();
        verify(notifier).sendLabMembershipRequest(eq(labHead), Matchers.any(String.class), eq(john), eq(approveUrl), Matchers.any(String.class));

        assertEquals(repo.findPendingByUser(john).size(), 1);       //one request
    }

    private boolean labIsActive(long lab) {
        try {
            userManagement.createPersonAndApproveMembership(Data.PAUL_INFO, "", lab, null);
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.