Re: Access the SecurityContext in Rest Service using a Junit test

2014-11-07 Thread Ulrich Metzger
; > >chain.doFilter(...); > > } > > } > > > > > > It should be fixed on trunk in the day BTW. > > > > > > > > Romain Manni-Bucau > > @rmannibucau > > http://www.tomitribe.com > > http://rmannibucau.wordpress.com &

Re: Access the SecurityContext in Rest Service using a Junit test

2014-11-07 Thread Ulrich Metzger
s things: > - maybe we dont wire security in httpejbd layer and we can desire it > - you can set yourself this threadlocal with an interceptor for instance or > a @WebFilter > > 2 will fix your issue today but 1 is surely better for a long term fix > Le 7 nov. 2014 07:35, "Ulrich Met

Re: Access the SecurityContext in Rest Service using a Junit test

2014-11-06 Thread Ulrich Metzger
bucau.wordpress.com > https://github.com/rmannibucau > > > 2014-11-06 17:35 GMT+00:00 Ulrich Metzger : > > Hi list, > > does anybody know how to mock a SecurityContext which gets injected in a > > Service Class exposed as Rest service in a junit test? > > > >

Access the SecurityContext in Rest Service using a Junit test

2014-11-06 Thread Ulrich Metzger
Hi list, does anybody know how to mock a SecurityContext which gets injected in a Service Class exposed as Rest service in a junit test? Here is the Service Class (the get method checks the currently logged in user): # ... @Path("/user") @Produces(MediaType.APPLICATION_JSON) @S