Search in sources :

Example 1 with UserRepository

use of ca.corefacility.bioinformatics.irida.repositories.user.UserRepository in project irida by phac-nml.

the class ProjectServiceImplTest method setUp.

@Before
public void setUp() {
    validator = mock(Validator.class);
    projectRepository = mock(ProjectRepository.class);
    sampleRepository = mock(SampleRepository.class);
    userRepository = mock(UserRepository.class);
    pujRepository = mock(ProjectUserJoinRepository.class);
    psjRepository = mock(ProjectSampleJoinRepository.class);
    relatedProjectRepository = mock(RelatedProjectRepository.class);
    referenceFileRepository = mock(ReferenceFileRepository.class);
    prfjRepository = mock(ProjectReferenceFileJoinRepository.class);
    ugpjRepository = mock(UserGroupProjectJoinRepository.class);
    sequencingObjectRepository = mock(SequencingObjectRepository.class);
    projectService = new ProjectServiceImpl(projectRepository, sampleRepository, userRepository, pujRepository, psjRepository, relatedProjectRepository, referenceFileRepository, prfjRepository, ugpjRepository, ssoRepository, pasRepository, sequencingObjectRepository, validator);
}
Also used : SampleRepository(ca.corefacility.bioinformatics.irida.repositories.sample.SampleRepository) RelatedProjectRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.RelatedProjectRepository) ProjectRepository(ca.corefacility.bioinformatics.irida.repositories.ProjectRepository) UserRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserRepository) RelatedProjectRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.RelatedProjectRepository) ProjectSampleJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository) SequencingObjectRepository(ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequencingObjectRepository) UserGroupProjectJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.UserGroupProjectJoinRepository) ProjectUserJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectUserJoinRepository) ReferenceFileRepository(ca.corefacility.bioinformatics.irida.repositories.referencefile.ReferenceFileRepository) Validator(javax.validation.Validator) ProjectReferenceFileJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectReferenceFileJoinRepository) ProjectServiceImpl(ca.corefacility.bioinformatics.irida.service.impl.ProjectServiceImpl) Before(org.junit.Before)

Example 2 with UserRepository

use of ca.corefacility.bioinformatics.irida.repositories.user.UserRepository in project irida by phac-nml.

the class PasswordExpiryCheckerTest method setUp.

@Before
public void setUp() {
    userRepository = mock(UserRepository.class);
    checker = new PasswordExpiryChecker(userRepository, 5);
    user = new User();
    user.setId(1L);
    user.setUsername("bob");
    revUser = new User();
    revUser.setId(1L);
    revUser.setUsername("bob");
    when(userRepository.loadUserByUsername(user.getUsername())).thenReturn(user);
}
Also used : UserRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserRepository) User(ca.corefacility.bioinformatics.irida.model.user.User) Before(org.junit.Before)

Example 3 with UserRepository

use of ca.corefacility.bioinformatics.irida.repositories.user.UserRepository in project irida by phac-nml.

the class ReadProjectPermissionTest method setUp.

@Before
public void setUp() {
    userRepository = mock(UserRepository.class);
    projectRepository = mock(ProjectRepository.class);
    pujRepository = mock(ProjectUserJoinRepository.class);
    ugpjRepository = mock(UserGroupProjectJoinRepository.class);
    ugRepository = mock(UserGroupJoinRepository.class);
    readProjectPermission = new ReadProjectPermission(projectRepository, userRepository, pujRepository, ugpjRepository, ugRepository);
}
Also used : ReadProjectPermission(ca.corefacility.bioinformatics.irida.security.permissions.project.ReadProjectPermission) UserRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserRepository) ProjectRepository(ca.corefacility.bioinformatics.irida.repositories.ProjectRepository) UserGroupProjectJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.UserGroupProjectJoinRepository) UserGroupJoinRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserGroupJoinRepository) ProjectUserJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectUserJoinRepository) Before(org.junit.Before)

Example 4 with UserRepository

use of ca.corefacility.bioinformatics.irida.repositories.user.UserRepository in project irida by phac-nml.

the class UpdateUserPermissionTest method setUp.

@Before
public void setUp() {
    userRepository = mock(UserRepository.class);
    updateUserPermission = new UpdateUserPermission(userRepository);
}
Also used : UserRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserRepository) UpdateUserPermission(ca.corefacility.bioinformatics.irida.security.permissions.user.UpdateUserPermission) Before(org.junit.Before)

Example 5 with UserRepository

use of ca.corefacility.bioinformatics.irida.repositories.user.UserRepository in project irida by phac-nml.

the class ReadSequencingObjectPermissionTest method setUp.

@Before
public void setUp() {
    userRepository = mock(UserRepository.class);
    ssoRepository = mock(SampleSequencingObjectJoinRepository.class);
    sequencingObjectRepository = mock(SequencingObjectRepository.class);
    psjRepository = mock(ProjectSampleJoinRepository.class);
    sampleRepository = mock(SampleRepository.class);
    readProjectPermission = mock(ReadProjectPermission.class);
    samplePermission = new ReadSamplePermission(sampleRepository, psjRepository, readProjectPermission);
    permission = new ReadSequencingObjectPermission(sequencingObjectRepository, samplePermission, ssoRepository);
}
Also used : SampleRepository(ca.corefacility.bioinformatics.irida.repositories.sample.SampleRepository) ReadSequencingObjectPermission(ca.corefacility.bioinformatics.irida.security.permissions.files.ReadSequencingObjectPermission) ReadProjectPermission(ca.corefacility.bioinformatics.irida.security.permissions.project.ReadProjectPermission) UserRepository(ca.corefacility.bioinformatics.irida.repositories.user.UserRepository) ProjectSampleJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository) SequencingObjectRepository(ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequencingObjectRepository) SampleSequencingObjectJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.sample.SampleSequencingObjectJoinRepository) ReadSamplePermission(ca.corefacility.bioinformatics.irida.security.permissions.sample.ReadSamplePermission) Before(org.junit.Before)

Aggregations

UserRepository (ca.corefacility.bioinformatics.irida.repositories.user.UserRepository)7 Before (org.junit.Before)7 ProjectUserJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectUserJoinRepository)3 ProjectRepository (ca.corefacility.bioinformatics.irida.repositories.ProjectRepository)2 ProjectSampleJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository)2 UserGroupProjectJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.UserGroupProjectJoinRepository)2 SampleRepository (ca.corefacility.bioinformatics.irida.repositories.sample.SampleRepository)2 SequencingObjectRepository (ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequencingObjectRepository)2 UserGroupJoinRepository (ca.corefacility.bioinformatics.irida.repositories.user.UserGroupJoinRepository)2 ReadProjectPermission (ca.corefacility.bioinformatics.irida.security.permissions.project.ReadProjectPermission)2 Validator (javax.validation.Validator)2 User (ca.corefacility.bioinformatics.irida.model.user.User)1 ProjectReferenceFileJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectReferenceFileJoinRepository)1 RelatedProjectRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.RelatedProjectRepository)1 SampleSequencingObjectJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.sample.SampleSequencingObjectJoinRepository)1 ReferenceFileRepository (ca.corefacility.bioinformatics.irida.repositories.referencefile.ReferenceFileRepository)1 UserGroupRepository (ca.corefacility.bioinformatics.irida.repositories.user.UserGroupRepository)1 ReadSequencingObjectPermission (ca.corefacility.bioinformatics.irida.security.permissions.files.ReadSequencingObjectPermission)1 ReadSamplePermission (ca.corefacility.bioinformatics.irida.security.permissions.sample.ReadSamplePermission)1 UpdateUserGroupPermission (ca.corefacility.bioinformatics.irida.security.permissions.user.UpdateUserGroupPermission)1