Home » Author Archives: Mike Ensor

Author Archives: Mike Ensor

AES-256 Encryption with Java and JCEKS


Overview Security has become a great topic of discussion in the last few years due to the recent releasing of documents from Edward Snowden and the explosion of hacking against online commerce stores like JC Penny, Sony and Target. While this post will not give you all of the tools to help prevent the use of illegally sourced data, this ...

Read More »

Spring 3.1, Cloud Foundry and Local Development


This post will help you build a Spring 3.1 web application using MongoDB on Cloud Foundry. In addition to pushing to Cloud Foundry, you will also be able to develop in your local environment with a MongoDB instance. Goals The goals for this blog posting will be to build the application locally, then publish to your local Cloud Foundry instance. ...

Read More »

Mocking with JodaTime’s DateTime and Google Guava’s Supplier


Introduction If you’re a seasoned unit tester, you’ve learned to take note when you see any code working with time, concurrency, random, persistence and disc I/O. The reason for this is that tests can be very brittle and sometimes down-right impossible to test properly. This post will show how to abstract out ‘time’ by injecting a replacement for it in ...

Read More »

Testing Custom Exceptions with JUnit’s ExpectedException and @Rule


Exception Testing Why test exception flows? Just like with all of your code, test coverage writes a contract between your code and the business functionality that the code is supposed to produce leaving you with a living documentation of the code along with the added ability to stress the functionality early and often. I won’t go into the many benefits ...

Read More »

JUnit Pass Test Case on Failures


Why create a mechanism to expect a test failure? There comes a time when one would want and expect a JUnit @Test case fail. Though this is pretty rare, it happens. I had the need to detect when a JUnit Test fails and then, if expected, to pass instead of fail. The specific case was that I was testing a ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.