Search in sources :

Example 11 with ProjectService

use of ca.corefacility.bioinformatics.irida.service.ProjectService in project irida by phac-nml.

the class ReferenceFileControllerTest method setUp.

@Before
public void setUp() {
    projectService = mock(ProjectService.class);
    referenceFileService = mock(ReferenceFileService.class);
    messageSource = mock(MessageSource.class);
    // Set up the reference file
    Path path = Paths.get(FILE_PATH);
    ReferenceFile file = new ReferenceFile(path);
    when(referenceFileService.read(FILE_ID)).thenReturn(file);
    controller = new ReferenceFileController(projectService, referenceFileService, messageSource);
}
Also used : Path(java.nio.file.Path) ReferenceFile(ca.corefacility.bioinformatics.irida.model.project.ReferenceFile) ReferenceFileController(ca.corefacility.bioinformatics.irida.ria.web.files.ReferenceFileController) ProjectService(ca.corefacility.bioinformatics.irida.service.ProjectService) MessageSource(org.springframework.context.MessageSource) ReferenceFileService(ca.corefacility.bioinformatics.irida.service.ReferenceFileService) Before(org.junit.Before)

Example 12 with ProjectService

use of ca.corefacility.bioinformatics.irida.service.ProjectService in project irida by phac-nml.

the class UserControllerTest method setUp.

@Before
public void setUp() {
    userService = mock(UserService.class);
    projectService = mock(ProjectService.class);
    controller = new RESTUsersController(userService, projectService);
    // fake out the servlet response so that the URI builder will work.
    RequestAttributes ra = new ServletRequestAttributes(new MockHttpServletRequest());
    RequestContextHolder.setRequestAttributes(ra);
}
Also used : UserService(ca.corefacility.bioinformatics.irida.service.user.UserService) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) ProjectService(ca.corefacility.bioinformatics.irida.service.ProjectService) RESTUsersController(ca.corefacility.bioinformatics.irida.web.controller.api.RESTUsersController) RequestAttributes(org.springframework.web.context.request.RequestAttributes) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) Before(org.junit.Before)

Example 13 with ProjectService

use of ca.corefacility.bioinformatics.irida.service.ProjectService in project irida by phac-nml.

the class RESTProjectSamplesControllerTest method setUp.

@Before
public void setUp() {
    projectService = mock(ProjectService.class);
    sampleService = mock(SampleService.class);
    controller = new RESTProjectSamplesController(projectService, sampleService);
}
Also used : SampleService(ca.corefacility.bioinformatics.irida.service.sample.SampleService) ProjectService(ca.corefacility.bioinformatics.irida.service.ProjectService) RESTProjectSamplesController(ca.corefacility.bioinformatics.irida.web.controller.api.projects.RESTProjectSamplesController) Before(org.junit.Before)

Aggregations

ProjectService (ca.corefacility.bioinformatics.irida.service.ProjectService)13 Before (org.junit.Before)13 UserService (ca.corefacility.bioinformatics.irida.service.user.UserService)9 MessageSource (org.springframework.context.MessageSource)9 SampleService (ca.corefacility.bioinformatics.irida.service.sample.SampleService)5 ProjectControllerUtils (ca.corefacility.bioinformatics.irida.ria.web.projects.ProjectControllerUtils)4 SequencingObjectService (ca.corefacility.bioinformatics.irida.service.SequencingObjectService)4 CartController (ca.corefacility.bioinformatics.irida.ria.web.analysis.CartController)3 UpdateSamplePermission (ca.corefacility.bioinformatics.irida.security.permissions.sample.UpdateSamplePermission)3 ReferenceFileService (ca.corefacility.bioinformatics.irida.service.ReferenceFileService)2 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2 RequestAttributes (org.springframework.web.context.request.RequestAttributes)2 ServletRequestAttributes (org.springframework.web.context.request.ServletRequestAttributes)2 ReferenceFile (ca.corefacility.bioinformatics.irida.model.project.ReferenceFile)1 User (ca.corefacility.bioinformatics.irida.model.user.User)1 AnalysisSubmissionSampleProcessor (ca.corefacility.bioinformatics.irida.pipeline.results.AnalysisSubmissionSampleProcessor)1 GalaxyToolDataService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyToolDataService)1 UsersController (ca.corefacility.bioinformatics.irida.ria.web.UsersController)1 ReferenceFileController (ca.corefacility.bioinformatics.irida.ria.web.files.ReferenceFileController)1 DTUser (ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTUser)1