Custom Framework Listeners

In my past articles, I’ve written about using custom listeners as part of getting the desired reporting or making your tests do what you want. I’ve always referred offhandedly to these listeners, never paying them direct attention. I figured it was finally time to actually write a full-fledged post about listeners and some useful tricks.

What Is a Listener?

Most testing frameworks (JUnit, TestNG, Cucumber, Robot…) have what they call a ‘listener.’ This is a class with methods that runs before or after your tests and has hooks into reporting and logging. It works within the framework to identify what passes, what fails, and maybe even why. Sometimes, these also include how and when tests are executed. Understanding how these listeners work can add additional insight into how your tests run. Understanding how these listeners can be modified can allow you greater control over your tests.

Running Cucumber With Maven

A little while ago (ok, maybe in the distant past), I started writing about Cucumber. My very first post detailed how to set up Cucumber JVM, and we’ve come a long way from then. I thought it was worth revisiting, as there are simpler ways to get set up, and better tools out there to use. So with that, let’s dive back in!

Build Tools

Previously, I was setting up the project by manually identifying and downloading each of the required jars into a lib directory. That is so last decade to do things. What we should be doing is orchestrating and controlling these dependencies with a build tool.

From Zero to Kubernetes: The Fast Track

Historically, enterprise Java development was known (and feared) for its steep learning curve. It was necessary to use dozens of lines of XML code just to deploy a simple application or to configure application servers. With the rise of DevOps, this hassle is merely the beginning of a long and painful process — the developer (or DevOps engineer, if you wish) is not only responsible for configuration but also for running the application. This has historically required either the creation of curator scripts that ensure that the application is running (and restarts it, in case it is not running), or manual intervention in case of application failure.

Modern Trends to The Rescue

Fortunately for us, the times of laborious configuration are over. Now it is possible to utilize tools which automate most tasks that were previously time-intensive or which required active monitoring. In this tutorial, we demonstrate how to create a simple application in Java (Spring Boot) and how to containerize it and deploy it in a Kubernetes cluster. Our application, even though simple in functionality, will have resiliency built-in and will recover automatically in the event of failure. Based on the example provided today, the whole application can easily be created and deployed into a testing cluster in under 30 minutes, without much configuration.

10 Essential Tools Every Java Developers Should Know

Hello, folks! We are already in the second month of 2019, and I am sure all of you have already made your goals about what to learn in 2019 and how to achieve them. I have been writing a series of articles to give you some ideas about the things you can learn and improve upon to become a better, well-rounded developer in 2019, learning new programming languages, frameworks, and libraries. These three things are extremely important to help you become a better Java developer, but as a wise person once said, "you are only as good as your tools." You should also look to upgrade your tools, learn new tools, and improve your understanding of old tolls that are still working well.

To help you with what tools you can learn in 2019, I have come up with this list of 10 essential tools for Java developers that I am going to share with you guys in this article. In the past, I have shared some useful testing tools for Java programmers, and this article is an extension of that, as it covers much more than automation testing tools.

Gradle Goodness: Only Show All Tasks in a Group [Snippet]

To get an overview of all Gradle tasks in our project, we need to run the tasks task. Since Gradle 5.1, we can use the --group option followed by a group name. Gradle will then show all tasks belonging to the group and not the other tasks in the project.

Suppose we have a Gradle Java project and want to show the tasks that belong to the build group:

Deploying Spring Boot 2.x Applications in WebLogic 12.1.3.1 Using Gradle Build

Deploying Spring Boot 2.x applications in WebLogic Versions 12.2.x is simpler than deploying those in WebLogic 12.1.x using Gradle build. I was struggling with the deployment of 2.x applications in 12.1.x version of WebLogic. There is no issue if you use Maven to build. But, using the Gradle build is complicated. But, finally, after some research got the solution and deployed successfully. Today, I will demonstrate how to deploy 2.x applications in 12.1.x version of WebLogic. Let's start. For my project, I'm using below tech stack:

a. Gradle 4.5+
b. Spring Boot 2.1.1.RELEASE
c. Java 8
d. WebLogic 12.1.3.1
e. javax.servlet 4.0.1 (Excliptly defining because of older WebLogic)

Visual Studio Code for Java: the Ultimate Guide 2019

Visual Studio Code has come a long way to become the preferred text editor of polyglot developers. Javascript, TypeScript, Go, Python, and other languages have a massive amount of developers coding through VS Code, in part thanks to the huge ecosystem of extensions that enhance and enrich the experience in VS Code, turning it into a super smart text editor with IDE-ish capabilities while remaining ludicrously fast and lightweight.

Unsurprisingly, VS Code can do Java as well, and many Java champions and speakers have chosen it for their on-stage appearances and live demos.

Spring Boot Magic Explained: Embedded Web Servers [Video]

As soon as you develop a web application with Spring Boot, you'll run an embedded web server like Tomcat or Jetty. Embedding these web servers serves as a prime example of how Spring Boot cleverly uses conditions, dependencies (Maven or Gradle), and a bit of code to produce magic that is hard to debug if you do not know what is going on. I highly recommended that you check out the video below if you want to deepen your Spring Boot knowledge.

In this short and practical episode, you will learn: