Home » Java » Page 22

Java

Parameterization with DataProvider in TestNG

java-interview-questions-answers

Parameterization in TestNG is also known as Parametric Testing which allows testing an application against multiple test data and configurations. Though we have to consider the fact that exhaustive testing is impossible, however, it is necessary to check the behavior of our application against different sets of data that an end-user can pass. Time and manual effort saving have always ...

Read More »

Creating Temporary Files with JUnit 5

This post shows you how to perform unit testing using temporary files with JUnit 5. If you’re still on JUnit 4, please check out my previous post! In JUnit 5, the @TempDir annotation is used to indicate that a field or method parameter of type Path or File is a temporary directory. Each test will use its own temporary directory ...

Read More »

Immutable Mutable Objects

There are some strong reasons why we may want to make genuinely immutable objects. Then there are various frameworks which operate on mutable objects, thus preventing us from using an immutable object pattern. Perhaps we even have a situation where a particular class needs to be mutable, but some of its objects need to be preserved immutably. We want to ...

Read More »

Sorting ArrayList in Reverse or Descending Order in Java 8

A quick guide on how to sort the arraylist in descending order or reverse order in java and example programs using Collections.reverseOrder() method. 1. Overview In this article, We will learn how to sort ArrayList in descending order in java. Sometimes this is referred as collections reverse or decreasing order. To get the list in the reverse order, we need ...

Read More »

Java NullPointerException Avoidance and Enhancement Tactics

An encountered NullPointerException can be a useful mechanism for highlighting when a certain code flow or certain data has led to unexpected results (and the messages provided by NullPointerException are much improved with JDK 15). However, there are other times when the presence of null is not an exceptional condition and for those such cases there are several tactics that ...

Read More »

Connecting to Kibana Within an AWS VPC

java-interview-questions-answers

When you use the managed Elasticsearch service on AWS, you usually choose an encrypted connection (via KMS-managed keys), which means you can’t use just any tool to connect to your Elasticsearch cluster. In fact, in order to manually execute commands the easiest option is to use the built-in Kibana and its dev tools. However, connecting to Kibana is also not ...

Read More »

Creating effective UI system tests with Selenium

java-interview-questions-answers

In this video, I’m showing how to create effective UI system tests with Selenium. In my previous video course on effective testing, I’ve introduced the coffee shop application, which we now enhanced with some basic HTML views. Selenium is a powerful web driver technology, to programmatically simulate user behavior in a browser, and helps us to create UI system tests. ...

Read More »