Search in sources :

Example 1 with ProjectSampleJoinRepository

use of ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository in project irida by phac-nml.

the class UpdateSamplePermissionTest method setUp.

@Before
public void setUp() {
    projectSampleJoinRepository = mock(ProjectSampleJoinRepository.class);
    projectOwnerPermission = mock(ProjectOwnerPermission.class);
    sampleRepository = mock(SampleRepository.class);
    updateSamplePermission = new UpdateSamplePermission(sampleRepository, projectOwnerPermission, projectSampleJoinRepository);
    Collection<GrantedAuthority> roles = new ArrayList<>();
    roles.add(Role.ROLE_USER);
    auth = new UsernamePasswordAuthenticationToken("fbristow", "password1", roles);
}
Also used : SampleRepository(ca.corefacility.bioinformatics.irida.repositories.sample.SampleRepository) ProjectOwnerPermission(ca.corefacility.bioinformatics.irida.security.permissions.project.ProjectOwnerPermission) ProjectSampleJoinRepository(ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository) GrantedAuthority(org.springframework.security.core.GrantedAuthority) ArrayList(java.util.ArrayList) UsernamePasswordAuthenticationToken(org.springframework.security.authentication.UsernamePasswordAuthenticationToken) UpdateSamplePermission(ca.corefacility.bioinformatics.irida.security.permissions.sample.UpdateSamplePermission) Before(org.junit.Before)

Aggregations

ProjectSampleJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.project.ProjectSampleJoinRepository)1 SampleRepository (ca.corefacility.bioinformatics.irida.repositories.sample.SampleRepository)1 ProjectOwnerPermission (ca.corefacility.bioinformatics.irida.security.permissions.project.ProjectOwnerPermission)1 UpdateSamplePermission (ca.corefacility.bioinformatics.irida.security.permissions.sample.UpdateSamplePermission)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 UsernamePasswordAuthenticationToken (org.springframework.security.authentication.UsernamePasswordAuthenticationToken)1 GrantedAuthority (org.springframework.security.core.GrantedAuthority)1