Examples of findPendingByUser()


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

    public void testHandleApproveLabMembershipRequest() {
        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
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0)//no labs
        uc.requestJohnLab3Membership();                               //create request from John to lab3
        assertEquals(repo.findPendingByUser(john).size(), 1);         //one request
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove())//handle request
View Full Code Here

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

        UserLabMembershipRequestRepository repo = getUserLabMemebershipRequestRepository();

        assertEquals(repo.findPendingByUser(john).size(), 0);              //no requests
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0)//no labs
        uc.requestJohnLab3Membership();                               //create request from John to lab3
        assertEquals(repo.findPendingByUser(john).size(), 1);         //one request
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove())//handle request
        assertEquals(repo.findPendingByUser(john).size(), 0);                             //no requests
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 1);                 //one lab
    }
View Full Code Here

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

        assertEquals(repo.findPendingByUser(john).size(), 0);              //no requests
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0)//no labs
        uc.requestJohnLab3Membership();                               //create request from John to lab3
        assertEquals(repo.findPendingByUser(john).size(), 1);         //one request
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove())//handle request
        assertEquals(repo.findPendingByUser(john).size(), 0);                             //no requests
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 1);                 //one lab
    }
View Full Code Here

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

        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0)//no labs
        uc.requestJohnLab3Membership();                               //create request from John to lab3
        assertEquals(repo.findPendingByUser(john).size(), 1);         //one request
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove())//handle request
        assertEquals(repo.findPendingByUser(john).size(), 0);                             //no requests
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 1);                 //one lab
    }

    @Test
    public void testHandleRefuseLabMembershipRequest() {
View Full Code Here

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

        uc.createPaul();
        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, uc.getRefuse());
        assertEquals(repo.findPendingByUser(john).size(), 0);
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0);
    }
View Full Code Here

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, uc.getRefuse());
        assertEquals(repo.findPendingByUser(john).size(), 0);
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0);
    }
View Full Code Here

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

        uc.requestJohnLab3Membership();
        assertEquals(repo.findPendingByUser(john).size(), 1);
        long requestId = repo.findPendingByUser(john).get(0).getId();
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getRefuse());
        assertEquals(repo.findPendingByUser(john).size(), 0);
        assertEquals(securityHelper.getUserDetails(john).labs.size(), 0);
    }

    @Test(expectedExceptions = RequestAlreadyHandledException.class)
    public void testHandleApproveLabMembershipRequestWhichAlreadyHandled() {
View Full Code Here

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

        uc.createPaul();
        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, uc.getApprove());
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove());
        fail("Exception was expected");
    }
View Full Code Here

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, uc.getApprove());
        userManagement.handleLabMembershipRequest(uc.getLab3(), requestId, uc.getApprove());
        fail("Exception was expected");
    }
View Full Code Here

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

        uc.createPaul();
        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");
    }
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.