Test-driven development is a pretty awesome design process. And while building your code, you may want to mimic the logged-in user. In Spring Security, the logged-in user principal is stored inside the Authentication object. This Authentication object can be accessed from any part of your application using SecurityContextHolder. The SecurityContextHolder is a singleton … [Read more...] about How To Mock SecurityContextHolder in Spring Security using Mockito?
test driven development
Mindset Behind Test Driven Development (TDD)
Do you find Test Driven Development (TDD) difficult to grasp? You might have tried writing test cases but ended up staring the blank screen for hours trying to come up with the correct test for your piece of code. Perhaps, you have started thinking that Test Driven Development is not for you. But before you come to the conclusion read this article. I'm sure you would want … [Read more...] about Mindset Behind Test Driven Development (TDD)