The site has moved to www.waygroup.se/education

Unit Testing with PowerMock


Writing unit tests can be hard, especially for code not designed with unit testing in mind. With PowerMock you can start building confidence for your code without any need of refactoring. You can also easily test interactions with legacy code, third-party frameworks and standard API:s. This is possible since Powermock goes beyond the technical limitations often enforced by other mock frameworks. PowerMock let's you mock static, private and final methods, test private methods, access internal state, remove static initializers, suppress constructors and much more. The course gives the students a pragmatic introduction to unit-testing with mock objects as well as hands-on experience with EasyMock and PowerMock.

Topics

  • Testing in general
  • JUnit
  • Mock objects and stubs
  • Designing for unit-tests   
  • EasyMock
  • Problems with unit testing
  • PowerMock
  • Testing legacy code
 

Target audience


This course is intended for Java developers that wants deeper knowledge in the field of testing code with mock objects. If you're already familiar with EasyMock and the concepts of mocking a more advanced 1 day version of this course is available.

Prerequisites


Basic Java development skills are required, some experience with unit testing or mock frameworks would be considered an advantage.
 

Course length

2 days