Search in sources :

Example 11 with UserService

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

the class AnnouncementsControllerTest method setUp.

@Before
public void setUp() {
    userService = mock(UserService.class);
    announcementService = mock(AnnouncementService.class);
    announcementsController = new AnnouncementsController(userService, announcementService);
    user = new User("testme", "test@me.com", "aaa", "John", "Curatcha", "2222222");
    Announcement a1 = new Announcement("First message", user);
    Announcement a2 = new Announcement("Second message", user);
    announcementList = Lists.newArrayList(a1, a2);
    AnnouncementUserJoin auj1 = new AnnouncementUserJoin(a1, user);
    AnnouncementUserJoin auj2 = new AnnouncementUserJoin(a2, user);
    announcementUserList = Lists.newArrayList(auj1, auj2);
}
Also used : User(ca.corefacility.bioinformatics.irida.model.user.User) AnnouncementUserJoin(ca.corefacility.bioinformatics.irida.model.announcements.AnnouncementUserJoin) AnnouncementService(ca.corefacility.bioinformatics.irida.service.AnnouncementService) Announcement(ca.corefacility.bioinformatics.irida.model.announcements.Announcement) UserService(ca.corefacility.bioinformatics.irida.service.user.UserService) AnnouncementsController(ca.corefacility.bioinformatics.irida.ria.web.AnnouncementsController) Before(org.junit.Before)

Example 12 with UserService

use of ca.corefacility.bioinformatics.irida.service.user.UserService 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)

Aggregations

UserService (ca.corefacility.bioinformatics.irida.service.user.UserService)12 Before (org.junit.Before)12 ProjectService (ca.corefacility.bioinformatics.irida.service.ProjectService)9 MessageSource (org.springframework.context.MessageSource)7 CartController (ca.corefacility.bioinformatics.irida.ria.web.analysis.CartController)3 ProjectControllerUtils (ca.corefacility.bioinformatics.irida.ria.web.projects.ProjectControllerUtils)3 PasswordResetService (ca.corefacility.bioinformatics.irida.service.user.PasswordResetService)3 User (ca.corefacility.bioinformatics.irida.model.user.User)2 UpdateSamplePermission (ca.corefacility.bioinformatics.irida.security.permissions.sample.UpdateSamplePermission)2 EmailController (ca.corefacility.bioinformatics.irida.service.EmailController)2 SequencingObjectService (ca.corefacility.bioinformatics.irida.service.SequencingObjectService)2 SampleService (ca.corefacility.bioinformatics.irida.service.sample.SampleService)2 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2 RequestAttributes (org.springframework.web.context.request.RequestAttributes)2 ServletRequestAttributes (org.springframework.web.context.request.ServletRequestAttributes)2 Announcement (ca.corefacility.bioinformatics.irida.model.announcements.Announcement)1 AnnouncementUserJoin (ca.corefacility.bioinformatics.irida.model.announcements.AnnouncementUserJoin)1 AnalysisSubmissionSampleProcessor (ca.corefacility.bioinformatics.irida.pipeline.results.AnalysisSubmissionSampleProcessor)1 GalaxyToolDataService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyToolDataService)1 CredentialsExpriredAuthenticationFailureHandler (ca.corefacility.bioinformatics.irida.ria.security.CredentialsExpriredAuthenticationFailureHandler)1