Junit @TempDir annotation

In this post under Junit, I will show with example the purpose and how to use @TempDir annotation. Lets say you have written class that zip the input file as shown below FileZip package package20; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class FileZip { public void zip(File inputFile) throws Exception…… Continue reading Junit @TempDir annotation

Calling custom mapping method from another mapper interface code

In this post under MapStruct, I will show with example how to call custom mapping method from another mapper interface code. In previous post, I showed you how to add custom mapping method to a mapper interface. But what if the same custom mapping method is also required by another mapper interface, we cannot copy…… Continue reading Calling custom mapping method from another mapper interface code

Text Block With Indentation

In this post under Java Core, I will show you with example how indentation is calculated in Text Block. Below is the main class with three variety of text block. Example3 package core.string; public class Example3 { public static void main(String[] args) { String textBlock1 = """ <html> <head> <title>TextBlock1<title> </head> <body>Body of TextBlock1</body> </html>…… Continue reading Text Block With Indentation