A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
  • Newsletters

mock

A collection of 2 posts
PowerMock, features and use-cases
Java

PowerMock, features and use-cases

Even if you don’t like it, your job sometimes requires you to maintain legacy applications. It happened to me (fortunately rarely), and the first thing I look for before writing as much as a single character in a legacy codebase is a unit testing harness. Most of the time, I tend to focus on the code coverage of the part of the application I need to change, and try to improve it as much as possible, even in the total lack of unit tests.

Oct 7, 2012
Java

Two different mocking approaches

Whether you choose to choose to adopt TDD or a more traditional approach, you will test your classes in isolation. This usually mean you code with interfaces and inject your dependencies in your classes. Last year, I had to test a servlet. Servlets are the showcase to demonstrate out-of-container testing because of their dependencies to said container in their doXxx() method. Every one of these methods has a dependency on HttpServletRequest and HttpServletResponse.

Apr 22, 2009
A Java geek © 2008-2026
v. 9744a65fcb2ff5057d025d26766c50d6f934fc0b/13747693232
Latest Posts