Home » Java » Page 21


Testing the File Upload API in Spring Boot


In one of my previous post, I had created an API to upload file. In this post I will write a JUnit test to test the API. We will test the complete flow right from uploading till it is copied to the file system and then we will also see how to mock the FileService class so that the uploaded ...

Read More »

Open-source collaboration, or how we finally added merge-on-refresh to Apache Lucene

The open-source software movement is a clearly a powerful phenomenon. A diverse (in time, geography, interests, gender (hmm not really, not yet, hrmph), race, skills, use-cases, age, corporate employer, motivation, IDEs (or,Emacs (with all of its recursive parens)), operating system, …) group of passionate developers work together, using surprisingly primitive digital tooling and asynchronous communication channels, devoid of emotion and ...

Read More »

Always Name Your Thread Pools

Our software tends to use a lot of thread pools – mostly through java.util.concurrent.ExecutorService implementations (Created via Executors.new.... We create these for various async use-cases, and they can be seen all over the place. All of these executors have a thread factory. It’s hidden in the default factory method, but you can supply a thread factory. If not supplied, a ...

Read More »

9 Of The Best Java Testing Frameworks For 2021

The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way to develop a new app. It holds more significance if you are a full-stack developer or expert programmer. Most developers prefer Java because of its platform independence ...

Read More »

Apache Camel 3.9 – No more saw tooth JVM garbage collection

We continue our effort to optimize Apache Camel. This is blog post part 7 which covers are latest effort on dramatically reducing the object allocations caused by Camel while routing messages. The good news is that we have overachieved and was able to reduce object allocations to ZERO!!! – so no more JVM memory usage graphs with saw tooth (note: ...

Read More »

Handling Injection Attacks in Java

An injection attack is the insertion of malicious data from the client to the application using SQL or XXE (XML External Entity).It is important to prevent injection attacks because it allows attackers to spoof identity, tamper with existing data, disclosure all the data, destroy the data, become the administrator, etc. SQL Injection If the attacker introduces something like ‘ or ...

Read More »