Monthly Archives: July 2013

Jersey Tests with Authentication

When I tested my REST-interface, which I implemented with Jersey, I also wanted to write Unit tests for an easy test. Since I spent some time to get authentication and autorisation working, I stood before another problem, when logging in and check access to my resources.

The problem that occured was that with each request a new session id was generated, which makes my authentication worthless. But I found a way around it:

So the secret is to save the cookie of the response and append it to each following request!

Posted in Uncategorized | 1 Comment

Grizzly Server: Static resources locked when server running

When I was finished setting up my neatly configured environment (grizzly, jersey, filters, static resources, …) I got annoyed when I started to work on the frontend. When the Grizzly server was running and e.g. the index.html was called, then there seems to be a file lock on that file. This prevents me from making changes to it so that I would have to stop the server, save the file and start the server to make the changes visible. This is no fun when developing!

Read more... (167 words, estimated 40 secs reading time)

Posted in Java, REST | Tagged , | Leave a comment