About the Author

Jonny Hackett

Twitter

Jonny is a Senior Software Engineer and Mentor with 15+ years of experience in IT. As a Java Developer, avid SportingKC fan, and photographer (check him out on www.Facebook.com/no9photography.) , Jonny is also our resident Spring Batch expert.

Spring Batch Testing & Mocking Revisited with Spring Boot

Jonny Hackett Development Technology, Java, Spring, Spring Batch, Spring Boot, Testing Leave a Comment

Several years ago, 2012 to be precise, I wrote an article on an approach to unit testing Spring Batch Jobs. My editors tell me that I still get new readers of the post every day, so it is time to revisit and update the approach to a more modern standard.

The approach used in the original post was purely testing the individual pieces containing any business logic. Back then, we didn’t have some of the mocking capabilities that we have today, so I went with an approach that made sense at the time.

However, there have been a few improvements in the past several years. One of those improvements has been the ability to Mock beans within a Spring Context. That’s where the @MockBean annotation comes to the rescue.

Using Apache POI With Protected Excel Files

Jonny Hackett Development Technology, Java, Spring Batch 1 Comment

While working on a recent project at a client, we had the opportunity to refactor some data extracts that were using a commercial Excel writing library, which we then converted to using the Apache POI Library for Excel. These data extracts were reports that included some calculated values, and depending on the client, were required to be password protected. When completed, the reports would be emailed to the recipients configured for each client.

In this post, we discuss the challenge of delivering protected Microsoft documents via email. We introduce a Java code solution for emailing password-protected Excel files when using the Apache POI Library.

Some of the required calculations we chose to implement using Excel formulas. Implementing formulas wasn’t a hard task and worked for what was needed.

Spring Batch: Multiple Format Output Writer

Jonny Hackett Java, Spring, Spring Batch 1 Comment

Attention: The following article was published over 4 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.Being a strong advocate of Spring Batch, I’ve always talked about the notion of Spring Batch providing developers with a framework that allows them to focus on solving business needs. By doing …

Spring Batch – Replacing XML Job Configuration With JavaConfig

Jonny Hackett Development Technology, Java, Spring, Spring Batch 7 Comments

Attention: The following article was published over 5 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.I recently assisted a client in getting up and running with a Spring Batch implementation. The team had decided to move forward with a JavaConfig-based configuration for their batch jobs instead of the traditional …

Processing Java Annotations Using Reflection

Jonny Hackett Development Technology, Java 5 Comments

Attention: The following article was published over 6 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.In my previous article covering Java Annotations, I outlined a recent use case and provided you with some examples of custom annotations and how they might be used. In this article, I’m going …