Search in sources :

Example 1 with RESTUsersController

use of ca.corefacility.bioinformatics.irida.web.controller.api.RESTUsersController 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

ProjectService (ca.corefacility.bioinformatics.irida.service.ProjectService)1 UserService (ca.corefacility.bioinformatics.irida.service.user.UserService)1 RESTUsersController (ca.corefacility.bioinformatics.irida.web.controller.api.RESTUsersController)1 Before (org.junit.Before)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1 RequestAttributes (org.springframework.web.context.request.RequestAttributes)1 ServletRequestAttributes (org.springframework.web.context.request.ServletRequestAttributes)1