this.userDAO = mock(UserDAO.class);
this.documentDAO = mock(DocumentDAO.class);
when(documentDAO.findByOwnerAndName(user, "document1.txt")).thenReturn(document);
this.resource = new LinksResource(userDAO, documentDAO);
this.credentials = mock(Credentials.class);
when(credentials.buildSession(userDAO, "bob")).thenReturn(session);
this.uriInfo = mock(UriInfo.class);