Learn how to unit test an ExecutorService instance without using the Thread.sleep() method.
Search Results for: exec
Creating PostgreSQL Schema Before Liquibase Execution
Learn how to create a PostgreSQL schema before Liquibase execution in Spring Boot.
Guide to ExecutorService vs. CompletableFuture
Explore two essential Java classes for handling asynchronous tasks: ExecutorService and CompletableFuture.
Difference Between execute() and submit() in Executor Service
Explore the key differences between execute() and submit() in Executor Service.
Executable Comments in Java
Learn how comments and Unicode escape sequences work together.
Stop Executing Further Code in Java
Explore multiple programmatic ways to stop the execution of further code in Java programs.
Executing SQL Script File in Java
Learn about the database utilities provided by MyBatis and Spring JDBC to execute SQL files.
How to Get Notified When a Task Completes in Java Executors
Learn several options for receiving notifications on the completion of a task depending on how you’re running it.
Execute a Method Only Once in Java
Discover different approaches to executing a method only once.
Execute Tests Based on Active Profile With JUnit 5
Learn how to execute tests based on the active Spring profile using JUnit 5.
Difference Between exchange(), postForEntity(), and execute() in RestTemplate
Learn three different ways to send a HTTP POST request using Spring’s RestTemplate.
Compiling and Executing Code From a String in Java
Learn how to turn a String containing Java source code into a compiled class and then execute it.
Thread vs. Single Thread Executor Service
Learn the difference between a thread and an executor service having a single worker thread.
Fixing Selenium WebDriver Executable Path Error
Understand what causes the Selenium error “The path to the driver executable must be set by the webdriver.chrome.driver system property” and learn how to fix it.
Guide to Creating Jar Executables and Windows Executables from Java
Learn how to package a Java program into a Jar and make them executable in Windows.
Get the Name of the Currently Executing Test in JUnit
Sometimes we need our unit tests to be able to access the name JUnit has allocated to them. This is especially useful when using name generators or parameterized tests. We look at how to solve this problem in both JUnit 4 and 5.
Parallel Test Execution for JUnit 5
In this article, we’ll cover how to execute parallel unit tests using JUnit 5.
How to Stop Execution After a Certain Time in Java
Learn different ways to end a long-running execution after a certain time in Java.
Prevent ApplicationRunner or CommandLineRunner Beans From Executing During Junit Testing
Learn how to prevent ApplicationRunner or CommandLineRunner beans from executing during JUnit tests.
ThreadPoolTaskExecutor corePoolSize vs. maxPoolSize
Learn about the corePoolSize and maxPoolSize properties in the ThreadPoolTaskExecutor.