You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fa...@apache.org on 2023/08/28 03:47:36 UTC

[flink] branch master updated: [FLINK-32835][runtime] Migrate unit tests in "accumulators" and "blob" packages to JUnit5

This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ef71327177 [FLINK-32835][runtime] Migrate unit tests in "accumulators" and "blob" packages to JUnit5
3ef71327177 is described below

commit 3ef713271771f9367166bcb31a6c08075f1d9617
Author: Ferenc Csaky <fe...@pm.me>
AuthorDate: Mon Aug 14 14:32:50 2023 +0200

    [FLINK-32835][runtime] Migrate unit tests in "accumulators" and "blob" packages to JUnit5
---
 .../java/org/apache/flink/hdfstests/HDFSTest.java  |  13 +-
 .../StringifiedAccumulatorResultTest.java          |  65 ++-
 .../flink/runtime/blob/BlobCacheCleanupTest.java   | 137 +++----
 .../runtime/blob/BlobCacheCorruptionTest.java      | 134 +------
 .../flink/runtime/blob/BlobCacheDeleteTest.java    | 165 ++++----
 .../flink/runtime/blob/BlobCacheGetTest.java       | 265 ++++++-------
 .../flink/runtime/blob/BlobCachePutTest.java       | 311 ++++++---------
 .../flink/runtime/blob/BlobCacheRecoveryTest.java  | 112 +-----
 .../flink/runtime/blob/BlobCacheRetriesTest.java   |  76 ++--
 .../runtime/blob/BlobCacheSizeTrackerTest.java     | 103 ++---
 .../flink/runtime/blob/BlobCacheSuccessTest.java   |  64 ++-
 .../flink/runtime/blob/BlobClientSslTest.java      |  57 +--
 .../apache/flink/runtime/blob/BlobClientTest.java  | 128 +++---
 .../org/apache/flink/runtime/blob/BlobKeyTest.java | 138 +++----
 .../flink/runtime/blob/BlobServerCleanupTest.java  | 101 +----
 .../runtime/blob/BlobServerCorruptionTest.java     |  83 +---
 .../flink/runtime/blob/BlobServerDeleteTest.java   | 133 +++----
 .../flink/runtime/blob/BlobServerGetTest.java      | 151 +++----
 .../flink/runtime/blob/BlobServerPutTest.java      | 240 +++++------
 .../flink/runtime/blob/BlobServerRangeTest.java    |  45 +--
 .../flink/runtime/blob/BlobServerRecoveryTest.java | 119 +-----
 ...obServerSSLTest.java => BlobServerSslTest.java} |  45 +--
 .../runtime/blob/BlobUtilsNonWritableTest.java     | 100 ++---
 .../apache/flink/runtime/blob/BlobUtilsTest.java   |  75 ++--
 .../runtime/blob/FileSystemBlobStoreTest.java      |  35 +-
 .../blob/PermanentBlobCacheSizeLimitTest.java      |  88 ++---
 .../flink/runtime/blob/PermanentBlobCacheTest.java |  12 +-
 .../flink/runtime/blob/TestingBlobHelpers.java     | 439 +++++++++++++++++++++
 .../flink/runtime/blob/TestingBlobUtils.java       | 145 ++++++-
 .../flink/runtime/blob/TransientBlobCacheTest.java |  12 +-
 .../librarycache/BlobLibraryCacheManagerTest.java  |   4 +-
 31 files changed, 1694 insertions(+), 1901 deletions(-)

diff --git a/flink-fs-tests/src/test/java/org/apache/flink/hdfstests/HDFSTest.java b/flink-fs-tests/src/test/java/org/apache/flink/hdfstests/HDFSTest.java
index 3144ba309e4..ffd0d37297d 100644
--- a/flink-fs-tests/src/test/java/org/apache/flink/hdfstests/HDFSTest.java
+++ b/flink-fs-tests/src/test/java/org/apache/flink/hdfstests/HDFSTest.java
@@ -30,12 +30,9 @@ import org.apache.flink.configuration.HighAvailabilityOptions;
 import org.apache.flink.core.fs.FileSystem;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.examples.java.wordcount.WordCount;
-import org.apache.flink.runtime.blob.BlobCacheCorruptionTest;
-import org.apache.flink.runtime.blob.BlobCacheRecoveryTest;
-import org.apache.flink.runtime.blob.BlobServerCorruptionTest;
-import org.apache.flink.runtime.blob.BlobServerRecoveryTest;
 import org.apache.flink.runtime.blob.BlobStoreService;
 import org.apache.flink.runtime.blob.BlobUtils;
+import org.apache.flink.runtime.blob.TestingBlobHelpers;
 import org.apache.flink.runtime.fs.hdfs.HadoopFileSystem;
 import org.apache.flink.runtime.jobmanager.HighAvailabilityMode;
 import org.apache.flink.util.OperatingSystem;
@@ -215,7 +212,7 @@ public class HDFSTest {
         BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
         try {
-            BlobServerRecoveryTest.testBlobServerRecovery(
+            TestingBlobHelpers.testBlobServerRecovery(
                     config, blobStoreService, temporaryFolder.newFolder());
         } finally {
             blobStoreService.closeAndCleanupAllData();
@@ -238,7 +235,7 @@ public class HDFSTest {
         BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
         try {
-            BlobServerCorruptionTest.testGetFailsFromCorruptFile(
+            TestingBlobHelpers.testGetFailsFromCorruptFile(
                     config, blobStoreService, temporaryFolder.newFolder());
         } finally {
             blobStoreService.closeAndCleanupAllData();
@@ -261,7 +258,7 @@ public class HDFSTest {
         BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
         try {
-            BlobCacheRecoveryTest.testBlobCacheRecovery(
+            TestingBlobHelpers.testBlobCacheRecovery(
                     config, blobStoreService, temporaryFolder.newFolder());
         } finally {
             blobStoreService.closeAndCleanupAllData();
@@ -284,7 +281,7 @@ public class HDFSTest {
         BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
         try {
-            BlobCacheCorruptionTest.testGetFailsFromCorruptFile(
+            TestingBlobHelpers.testGetFailsFromCorruptFile(
                     new JobID(), config, blobStoreService, temporaryFolder.newFolder());
         } finally {
             blobStoreService.closeAndCleanupAllData();
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResultTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResultTest.java
index c08164a7039..13861ae84d5 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResultTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResultTest.java
@@ -25,21 +25,20 @@ import org.apache.flink.core.testutils.CommonTestUtils;
 import org.apache.flink.util.FlinkRuntimeException;
 import org.apache.flink.util.OptionalFailure;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for the {@link StringifiedAccumulatorResult}. */
-public class StringifiedAccumulatorResultTest {
+class StringifiedAccumulatorResultTest {
 
     @Test
-    public void testSerialization() throws IOException {
+    void testSerialization() throws IOException {
         final String name = "a";
         final String type = "b";
         final String value = "c";
@@ -47,20 +46,20 @@ public class StringifiedAccumulatorResultTest {
                 new StringifiedAccumulatorResult(name, type, value);
 
         // Confirm no funny business in the constructor to getter pathway
-        assertEquals(name, original.getName());
-        assertEquals(type, original.getType());
-        assertEquals(value, original.getValue());
+        assertThat(original.getName()).isEqualTo(name);
+        assertThat(original.getType()).isEqualTo(type);
+        assertThat(original.getValue()).isEqualTo(value);
 
         final StringifiedAccumulatorResult copy = CommonTestUtils.createCopySerializable(original);
 
         // Copy should have equivalent core fields
-        assertEquals(name, copy.getName());
-        assertEquals(type, copy.getType());
-        assertEquals(value, copy.getValue());
+        assertThat(copy.getName()).isEqualTo(name);
+        assertThat(copy.getType()).isEqualTo(type);
+        assertThat(copy.getValue()).isEqualTo(value);
     }
 
     @Test
-    public void stringifyingResultsShouldIncorporateAccumulatorLocalValueDirectly() {
+    void stringifyingResultsShouldIncorporateAccumulatorLocalValueDirectly() {
         final String name = "a";
         final int targetValue = 314159;
         final IntCounter acc = new IntCounter();
@@ -71,16 +70,16 @@ public class StringifiedAccumulatorResultTest {
         final StringifiedAccumulatorResult[] results =
                 StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap);
 
-        assertEquals(1, results.length);
+        assertThat(results).hasSize(1);
 
         final StringifiedAccumulatorResult firstResult = results[0];
-        assertEquals(name, firstResult.getName());
-        assertEquals("IntCounter", firstResult.getType());
-        assertEquals(Integer.toString(targetValue), firstResult.getValue());
+        assertThat(firstResult.getName()).isEqualTo(name);
+        assertThat(firstResult.getType()).isEqualTo("IntCounter");
+        assertThat(firstResult.getValue()).isEqualTo(Integer.toString(targetValue));
     }
 
     @Test
-    public void stringifyingResultsShouldReportNullLocalValueAsNonnullValueString() {
+    void stringifyingResultsShouldReportNullLocalValueAsNonnullValueString() {
         final String name = "a";
         final NullBearingAccumulator acc = new NullBearingAccumulator();
         final Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = new HashMap<>();
@@ -89,17 +88,17 @@ public class StringifiedAccumulatorResultTest {
         final StringifiedAccumulatorResult[] results =
                 StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap);
 
-        assertEquals(1, results.length);
+        assertThat(results).hasSize(1);
 
         // Note the use of a String with a content of "null" rather than a null value
         final StringifiedAccumulatorResult firstResult = results[0];
-        assertEquals(name, firstResult.getName());
-        assertEquals("NullBearingAccumulator", firstResult.getType());
-        assertEquals("null", firstResult.getValue());
+        assertThat(firstResult.getName()).isEqualTo(name);
+        assertThat(firstResult.getType()).isEqualTo("NullBearingAccumulator");
+        assertThat(firstResult.getValue()).isEqualTo("null");
     }
 
     @Test
-    public void stringifyingResultsShouldReportNullAccumulatorWithNonnullValueAndTypeString() {
+    void stringifyingResultsShouldReportNullAccumulatorWithNonnullValueAndTypeString() {
         final String name = "a";
         final Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = new HashMap<>();
         accumulatorMap.put(name, null);
@@ -107,17 +106,17 @@ public class StringifiedAccumulatorResultTest {
         final StringifiedAccumulatorResult[] results =
                 StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap);
 
-        assertEquals(1, results.length);
+        assertThat(results).hasSize(1);
 
         // Note the use of String values with content of "null" rather than null values
         final StringifiedAccumulatorResult firstResult = results[0];
-        assertEquals(name, firstResult.getName());
-        assertEquals("null", firstResult.getType());
-        assertEquals("null", firstResult.getValue());
+        assertThat(firstResult.getName()).isEqualTo(name);
+        assertThat(firstResult.getType()).isEqualTo("null");
+        assertThat(firstResult.getValue()).isEqualTo("null");
     }
 
     @Test
-    public void stringifyingFailureResults() {
+    void stringifyingFailureResults() {
         final String name = "a";
         final Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = new HashMap<>();
         accumulatorMap.put(name, OptionalFailure.ofFailure(new FlinkRuntimeException("Test")));
@@ -125,16 +124,14 @@ public class StringifiedAccumulatorResultTest {
         final StringifiedAccumulatorResult[] results =
                 StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap);
 
-        assertEquals(1, results.length);
+        assertThat(results).hasSize(1);
 
         // Note the use of String values with content of "null" rather than null values
         final StringifiedAccumulatorResult firstResult = results[0];
-        assertEquals(name, firstResult.getName());
-        assertEquals("null", firstResult.getType());
-        assertTrue(
-                firstResult
-                        .getValue()
-                        .startsWith("org.apache.flink.util.FlinkRuntimeException: Test"));
+        assertThat(firstResult.getName()).isEqualTo(name);
+        assertThat(firstResult.getType()).isEqualTo("null");
+        assertThat(firstResult.getValue())
+                .startsWith("org.apache.flink.util.FlinkRuntimeException: Test");
     }
 
     private static class NullBearingAccumulator implements SimpleAccumulator<Serializable> {
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCleanupTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCleanupTest.java
index 6940ed82d0b..50d054ac66e 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCleanupTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCleanupTest.java
@@ -23,20 +23,19 @@ import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.MemorySize;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 import org.apache.flink.util.FlinkException;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
-import org.hamcrest.collection.IsEmptyCollection;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -50,29 +49,26 @@ import java.util.concurrent.Executors;
 
 import static org.apache.flink.runtime.blob.BlobCachePutTest.verifyDeletedEventually;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFileCountForJob;
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFilesExist;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFileCountForJob;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFilesExist;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** A few tests for the cleanup of {@link PermanentBlobCache} and {@link TransientBlobCache}. */
-public class BlobCacheCleanupTest extends TestLogger {
+class BlobCacheCleanupTest {
 
-    private final Random rnd = new Random();
+    @TempDir private Path tempDir;
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    private final Random rnd = new Random();
 
     /**
      * Tests that {@link PermanentBlobCache} cleans up after calling {@link
      * PermanentBlobCache#releaseJob(JobID)}.
      */
     @Test
-    public void testPermanentBlobCleanup() throws IOException, InterruptedException {
+    void testPermanentBlobCleanup() throws IOException, InterruptedException {
 
         JobID jobId = new JobID();
         List<PermanentBlobKey> keys = new ArrayList<>();
@@ -85,15 +81,10 @@ public class BlobCacheCleanupTest extends TestLogger {
             Configuration config = new Configuration();
             config.setLong(BlobServerOptions.CLEANUP_INTERVAL, 1L);
 
-            server = new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
+            server = TestingBlobUtils.createServer(tempDir, config);
             server.start();
-            InetSocketAddress serverAddress = new InetSocketAddress("localhost", server.getPort());
-            cache =
-                    new PermanentBlobCache(
-                            config,
-                            temporaryFolder.newFolder(),
-                            new VoidBlobStore(),
-                            serverAddress);
+
+            cache = TestingBlobUtils.createPermanentCache(tempDir, config, server);
 
             // upload blobs
             keys.add(server.putPermanent(jobId, buf));
@@ -119,14 +110,14 @@ public class BlobCacheCleanupTest extends TestLogger {
                 cache.getFile(jobId, key);
             }
 
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, server);
             checkFileCountForJob(2, jobId, cache);
 
             // after releasing once, nothing should change
             cache.releaseJob(jobId);
 
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, server);
             checkFileCountForJob(2, jobId, cache);
 
@@ -153,7 +144,7 @@ public class BlobCacheCleanupTest extends TestLogger {
      * when registering, releasing, and re-registering jobs.
      */
     @Test
-    public void testPermanentJobReferences() throws IOException {
+    void testPermanentJobReferences() throws IOException {
 
         JobID jobId = new JobID();
 
@@ -166,46 +157,43 @@ public class BlobCacheCleanupTest extends TestLogger {
         InetSocketAddress serverAddress = new InetSocketAddress("localhost", 12345);
 
         try (PermanentBlobCache cache =
-                new PermanentBlobCache(
-                        config, temporaryFolder.newFolder(), new VoidBlobStore(), serverAddress)) {
+                TestingBlobUtils.createPermanentCache(tempDir, config, serverAddress)) {
 
             // register once
             cache.registerJob(jobId);
-            assertEquals(1, cache.getJobRefCounters().get(jobId).references);
-            assertEquals(-1, cache.getJobRefCounters().get(jobId).keepUntil);
+            assertThat(cache.getJobRefCounters().get(jobId).references).isOne();
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil).isEqualTo(-1);
 
             // register a second time
             cache.registerJob(jobId);
-            assertEquals(2, cache.getJobRefCounters().get(jobId).references);
-            assertEquals(-1, cache.getJobRefCounters().get(jobId).keepUntil);
+            assertThat(cache.getJobRefCounters().get(jobId).references).isEqualTo(2);
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil).isEqualTo(-1);
 
             // release once
             cache.releaseJob(jobId);
-            assertEquals(1, cache.getJobRefCounters().get(jobId).references);
-            assertEquals(-1, cache.getJobRefCounters().get(jobId).keepUntil);
+            assertThat(cache.getJobRefCounters().get(jobId).references).isOne();
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil).isEqualTo(-1);
 
             // release a second time
             long cleanupLowerBound =
                     System.currentTimeMillis() + config.getLong(BlobServerOptions.CLEANUP_INTERVAL);
             cache.releaseJob(jobId);
-            assertEquals(0, cache.getJobRefCounters().get(jobId).references);
-            assertThat(
-                    cache.getJobRefCounters().get(jobId).keepUntil,
-                    greaterThanOrEqualTo(cleanupLowerBound));
+            assertThat(cache.getJobRefCounters().get(jobId).references).isZero();
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil)
+                    .isGreaterThanOrEqualTo(cleanupLowerBound);
 
             // register again
             cache.registerJob(jobId);
-            assertEquals(1, cache.getJobRefCounters().get(jobId).references);
-            assertEquals(-1, cache.getJobRefCounters().get(jobId).keepUntil);
+            assertThat(cache.getJobRefCounters().get(jobId).references).isOne();
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil).isEqualTo(-1);
 
             // finally release the job
             cleanupLowerBound =
                     System.currentTimeMillis() + config.getLong(BlobServerOptions.CLEANUP_INTERVAL);
             cache.releaseJob(jobId);
-            assertEquals(0, cache.getJobRefCounters().get(jobId).references);
-            assertThat(
-                    cache.getJobRefCounters().get(jobId).keepUntil,
-                    greaterThanOrEqualTo(cleanupLowerBound));
+            assertThat(cache.getJobRefCounters().get(jobId).references).isZero();
+            assertThat(cache.getJobRefCounters().get(jobId).keepUntil)
+                    .isGreaterThanOrEqualTo(cleanupLowerBound);
         }
     }
 
@@ -215,9 +203,9 @@ public class BlobCacheCleanupTest extends TestLogger {
      * cleaned up.
      */
     @Test
-    @Ignore(
+    @Disabled(
             "manual test due to stalling: ensures a BLOB is retained first and only deleted after the (long) timeout ")
-    public void testPermanentBlobDeferredCleanup() throws IOException, InterruptedException {
+    void testPermanentBlobDeferredCleanup() throws IOException, InterruptedException {
         // file should be deleted between 5 and 10s after last job release
         long cleanupInterval = 5L;
 
@@ -232,18 +220,13 @@ public class BlobCacheCleanupTest extends TestLogger {
             Configuration config = new Configuration();
             config.setLong(BlobServerOptions.CLEANUP_INTERVAL, cleanupInterval);
 
-            server = new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
+            server = new BlobServer(config, TempDirUtils.newFolder(tempDir), new VoidBlobStore());
             server.start();
-            InetSocketAddress serverAddress = new InetSocketAddress("localhost", server.getPort());
+
             final BlobCacheSizeTracker tracker =
                     new BlobCacheSizeTracker(MemorySize.ofMebiBytes(100).getBytes());
-            cache =
-                    new PermanentBlobCache(
-                            config,
-                            temporaryFolder.newFolder(),
-                            new VoidBlobStore(),
-                            serverAddress,
-                            tracker);
+
+            cache = TestingBlobUtils.createPermanentCache(tempDir, config, server, tracker);
 
             // upload blobs
             keys.add(server.putPermanent(jobId, buf));
@@ -271,7 +254,7 @@ public class BlobCacheCleanupTest extends TestLogger {
                 cache.readFile(jobId, key);
             }
 
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, server);
             checkFileCountForJob(2, jobId, cache);
             checkBlobCacheSizeTracker(tracker, jobId, 2);
@@ -279,7 +262,7 @@ public class BlobCacheCleanupTest extends TestLogger {
             // after releasing once, nothing should change
             cache.releaseJob(jobId);
 
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, server);
             checkFileCountForJob(2, jobId, cache);
             checkBlobCacheSizeTracker(tracker, jobId, 2);
@@ -288,12 +271,12 @@ public class BlobCacheCleanupTest extends TestLogger {
             cache.releaseJob(jobId);
 
             // files should still be accessible for now
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, cache);
 
             Thread.sleep(cleanupInterval / 5);
             // still accessible...
-            assertEquals(2, checkFilesExist(jobId, keys, cache, true));
+            assertThat(checkFilesExist(jobId, keys, cache, true)).isEqualTo(2);
             checkFileCountForJob(2, jobId, cache);
 
             Thread.sleep((cleanupInterval * 4) / 5);
@@ -317,12 +300,12 @@ public class BlobCacheCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testTransientBlobNoJobCleanup() throws Exception {
+    void testTransientBlobNoJobCleanup() throws Exception {
         testTransientBlobCleanup(null);
     }
 
     @Test
-    public void testTransientBlobForJobCleanup() throws Exception {
+    void testTransientBlobForJobCleanup() throws Exception {
         testTransientBlobCleanup(new JobID());
     }
 
@@ -348,15 +331,12 @@ public class BlobCacheCleanupTest extends TestLogger {
 
         long cleanupLowerBound;
 
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir, config);
+
         final ExecutorService executorService = Executors.newSingleThreadExecutor();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                final BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             ConcurrentMap<Tuple2<JobID, TransientBlobKey>, Long> transientBlobExpiryTimes =
                     cache.getTransientBlobService().getBlobExpiryTimes();
 
@@ -371,19 +351,18 @@ public class BlobCacheCleanupTest extends TestLogger {
             cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
             verifyContents(cache, jobId, key1, data);
             final Long key1ExpiryFirstAccess = transientBlobExpiryTimes.get(Tuple2.of(jobId, key1));
-            assertThat(key1ExpiryFirstAccess, greaterThanOrEqualTo(cleanupLowerBound));
-            assertNull(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)));
+            assertThat(key1ExpiryFirstAccess).isGreaterThanOrEqualTo(cleanupLowerBound);
+            assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2))).isNull();
 
             // access key2, verify expiry times (delay at least 1ms to also verify key1 expiry is
             // unchanged)
             Thread.sleep(1);
             cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
             verifyContents(cache, jobId, key2, data2);
-            assertEquals(
-                    key1ExpiryFirstAccess, transientBlobExpiryTimes.get(Tuple2.of(jobId, key1)));
-            assertThat(
-                    transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)),
-                    greaterThanOrEqualTo(cleanupLowerBound));
+            assertThat(key1ExpiryFirstAccess)
+                    .isEqualTo(transientBlobExpiryTimes.get(Tuple2.of(jobId, key1)));
+            assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)))
+                    .isGreaterThanOrEqualTo(cleanupLowerBound);
 
             // files are cached now for the given TTL - remove from server so that they are not
             // re-downloaded
@@ -429,7 +408,7 @@ public class BlobCacheCleanupTest extends TestLogger {
 
             verifyDeletedEventually(server, jobId, key1, key2);
         } finally {
-            assertThat(executorService.shutdownNow(), IsEmptyCollection.empty());
+            assertThat(executorService.shutdownNow()).isEmpty();
         }
     }
 
@@ -462,6 +441,6 @@ public class BlobCacheCleanupTest extends TestLogger {
 
     private static void checkBlobCacheSizeTracker(
             BlobCacheSizeTracker tracker, JobID jobId, int expected) {
-        assertEquals(tracker.getBlobKeysByJobId(jobId).size(), expected);
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(expected);
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCorruptionTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCorruptionTest.java
index a2e40c62ddc..237e134f989 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCorruptionTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheCorruptionTest.java
@@ -21,57 +21,43 @@ package org.apache.flink.runtime.blob;
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.core.testutils.FlinkAssertions;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.apache.commons.io.FileUtils;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
-import javax.annotation.Nullable;
-
-import java.io.File;
 import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.Random;
+import java.nio.file.Path;
 
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 /**
  * Tests how GET requests react to corrupt files when downloaded via a {@link BlobCacheService}.
  *
  * <p>Successful GET requests are tested in conjunction wit the PUT requests.
  */
-public class BlobCacheCorruptionTest extends TestLogger {
+class BlobCacheCorruptionTest {
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     @Test
-    public void testGetFailsFromCorruptFile1() throws IOException {
+    void testGetFailsFromCorruptFile1() throws IOException {
         testGetFailsFromCorruptFile(null, TRANSIENT_BLOB, false);
     }
 
     @Test
-    public void testGetFailsFromCorruptFile2() throws IOException {
+    void testGetFailsFromCorruptFile2() throws IOException {
         testGetFailsFromCorruptFile(new JobID(), TRANSIENT_BLOB, false);
     }
 
     @Test
-    public void testGetFailsFromCorruptFile3() throws IOException {
+    void testGetFailsFromCorruptFile3() throws IOException {
         testGetFailsFromCorruptFile(new JobID(), PERMANENT_BLOB, false);
     }
 
     @Test
-    public void testGetFailsFromCorruptFile4() throws IOException {
+    void testGetFailsFromCorruptFile4() throws IOException {
         testGetFailsFromCorruptFile(new JobID(), PERMANENT_BLOB, true);
     }
 
@@ -92,118 +78,24 @@ public class BlobCacheCorruptionTest extends TestLogger {
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStoreService = null;
 
         try {
             blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
-            testGetFailsFromCorruptFile(
+            TestingBlobHelpers.testGetFailsFromCorruptFile(
                     jobId,
                     blobType,
                     corruptOnHAStore,
                     config,
                     blobStoreService,
-                    TEMPORARY_FOLDER.newFolder());
+                    TempDirUtils.newFolder(tempDir));
         } finally {
             if (blobStoreService != null) {
                 blobStoreService.closeAndCleanupAllData();
             }
         }
     }
-
-    /**
-     * Checks the GET operation fails when the downloaded file (from HA store) is corrupt, i.e. its
-     * content's hash does not match the {@link BlobKey}'s hash, using a permanent BLOB.
-     *
-     * @param jobId job ID
-     * @param config blob server configuration (including HA settings like {@link
-     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
-     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
-     * @param blobStore shared HA blob store to use
-     */
-    public static void testGetFailsFromCorruptFile(
-            JobID jobId, Configuration config, BlobStore blobStore, File blobStorage)
-            throws IOException {
-
-        testGetFailsFromCorruptFile(jobId, PERMANENT_BLOB, true, config, blobStore, blobStorage);
-    }
-
-    /**
-     * Checks the GET operation fails when the downloaded file (from {@link BlobServer} or HA store)
-     * is corrupt, i.e. its content's hash does not match the {@link BlobKey}'s hash.
-     *
-     * @param jobId job ID or <tt>null</tt> if job-unrelated
-     * @param blobType whether the BLOB should become permanent or transient
-     * @param corruptOnHAStore whether the file should be corrupt in the HA store (<tt>true</tt>,
-     *     required <tt>highAvailability</tt> to be set) or on the {@link BlobServer}'s local store
-     *     (<tt>false</tt>)
-     * @param config blob server configuration (including HA settings like {@link
-     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
-     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
-     * @param blobStore shared HA blob store to use
-     */
-    private static void testGetFailsFromCorruptFile(
-            @Nullable JobID jobId,
-            BlobKey.BlobType blobType,
-            boolean corruptOnHAStore,
-            Configuration config,
-            BlobStore blobStore,
-            File blobStorage)
-            throws IOException {
-
-        assertTrue(
-                "corrupt HA file requires a HA setup",
-                !corruptOnHAStore || blobType == PERMANENT_BLOB);
-
-        Random rnd = new Random();
-
-        try (BlobServer server =
-                        new BlobServer(config, new File(blobStorage, "server"), blobStore);
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                new File(blobStorage, "cache"),
-                                corruptOnHAStore ? blobStore : new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
-            server.start();
-
-            byte[] data = new byte[2000000];
-            rnd.nextBytes(data);
-
-            // put content addressable (like libraries)
-            BlobKey key = put(server, jobId, data, blobType);
-            assertNotNull(key);
-
-            // change server/HA store file contents to make sure that GET requests fail
-            byte[] data2 = Arrays.copyOf(data, data.length);
-            data2[0] ^= 1;
-            if (corruptOnHAStore) {
-                File tmpFile = Files.createTempFile("blob", ".jar").toFile();
-                try {
-                    FileUtils.writeByteArrayToFile(tmpFile, data2);
-                    blobStore.put(tmpFile, jobId, key);
-                } finally {
-                    //noinspection ResultOfMethodCallIgnored
-                    tmpFile.delete();
-                }
-
-                // delete local (correct) file on server to make sure that the GET request does not
-                // fall back to downloading the file from the BlobServer's local store
-                File blobFile = server.getStorageLocation(jobId, key);
-                assertTrue(blobFile.delete());
-            } else {
-                File blobFile = server.getStorageLocation(jobId, key);
-                assertTrue(blobFile.exists());
-                FileUtils.writeByteArrayToFile(blobFile, data2);
-            }
-
-            // issue a GET request that fails
-            assertThatThrownBy(() -> get(cache, jobId, key))
-                    .satisfies(
-                            FlinkAssertions.anyCauseMatches(IOException.class, "data corruption"));
-        }
-    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
index a47e98579ed..10c1ae75513 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
@@ -19,21 +19,19 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
-import org.apache.flink.configuration.Configuration;
+import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetSocketAddress;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -50,40 +48,38 @@ import static org.apache.flink.runtime.blob.BlobServerDeleteTest.delete;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /** Tests how DELETE requests behave. */
-public class BlobCacheDeleteTest extends TestLogger {
+class BlobCacheDeleteTest {
 
-    private final Random rnd = new Random();
+    @TempDir private Path tempDir;
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    private final Random rnd = new Random();
 
     @Test
-    public void testDeleteTransient1() throws IOException {
+    void testDeleteTransient1() throws IOException {
         testDelete(null, new JobID());
     }
 
     @Test
-    public void testDeleteTransient2() throws IOException {
+    void testDeleteTransient2() throws IOException {
         testDelete(new JobID(), null);
     }
 
     @Test
-    public void testDeleteTransient3() throws IOException {
+    void testDeleteTransient3() throws IOException {
         testDelete(null, null);
     }
 
     @Test
-    public void testDeleteTransient4() throws IOException {
+    void testDeleteTransient4() throws IOException {
         testDelete(new JobID(), new JobID());
     }
 
     @Test
-    public void testDeleteTransient5() throws IOException {
+    void testDeleteTransient5() throws IOException {
         JobID jobId = new JobID();
         testDelete(jobId, jobId);
     }
@@ -96,18 +92,11 @@ public class BlobCacheDeleteTest extends TestLogger {
      * @param jobId2 second job id
      */
     private void testDelete(@Nullable JobID jobId1, @Nullable JobID jobId2) throws IOException {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -117,24 +106,24 @@ public class BlobCacheDeleteTest extends TestLogger {
 
             // put first BLOB
             TransientBlobKey key1 = (TransientBlobKey) put(server, jobId1, data, TRANSIENT_BLOB);
-            assertNotNull(key1);
+            assertThat(key1).isNotNull();
 
             // put two more BLOBs (same key, other key) for another job ID
             TransientBlobKey key2a = (TransientBlobKey) put(server, jobId2, data, TRANSIENT_BLOB);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             BlobKeyTest.verifyKeyDifferentHashEquals(key1, key2a);
             TransientBlobKey key2b = (TransientBlobKey) put(server, jobId2, data2, TRANSIENT_BLOB);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             BlobKeyTest.verifyKeyDifferentHashDifferent(key1, key2b);
 
             // issue a DELETE request
-            assertTrue(delete(cache, jobId1, key1));
+            assertThat(delete(cache, jobId1, key1)).isTrue();
 
             // delete only works on local cache!
-            assertTrue(server.getStorageLocation(jobId1, key1).exists());
+            assertThat(server.getStorageLocation(jobId1, key1)).exists();
             // delete on server so that the cache cannot re-download
-            assertTrue(server.deleteInternal(jobId1, key1));
-            assertFalse(server.getStorageLocation(jobId1, key1).exists());
+            assertThat(server.deleteInternal(jobId1, key1)).isTrue();
+            assertThat(server.getStorageLocation(jobId1, key1)).doesNotExist();
             verifyDeleted(cache, jobId1, key1);
             // deleting one BLOB should not affect another BLOB with a different key
             // (and keys are always different now)
@@ -142,31 +131,31 @@ public class BlobCacheDeleteTest extends TestLogger {
             verifyContents(server, jobId2, key2b, data2);
 
             // delete first file of second job
-            assertTrue(delete(cache, jobId2, key2a));
+            assertThat(delete(cache, jobId2, key2a)).isTrue();
             // delete only works on local cache
-            assertTrue(server.getStorageLocation(jobId2, key2a).exists());
+            assertThat(server.getStorageLocation(jobId2, key2a)).exists();
             // delete on server so that the cache cannot re-download
-            assertTrue(server.deleteInternal(jobId2, key2a));
+            assertThat(server.deleteInternal(jobId2, key2a)).isTrue();
             verifyDeleted(cache, jobId2, key2a);
             verifyContents(server, jobId2, key2b, data2);
 
             // delete second file of second job
-            assertTrue(delete(cache, jobId2, key2b));
+            assertThat(delete(cache, jobId2, key2b)).isTrue();
             // delete only works on local cache
-            assertTrue(server.getStorageLocation(jobId2, key2b).exists());
+            assertThat(server.getStorageLocation(jobId2, key2b)).exists();
             // delete on server so that the cache cannot re-download
-            assertTrue(server.deleteInternal(jobId2, key2b));
+            assertThat(server.deleteInternal(jobId2, key2b)).isTrue();
             verifyDeleted(cache, jobId2, key2b);
         }
     }
 
     @Test
-    public void testDeleteTransientAlreadyDeletedNoJob() throws IOException {
+    void testDeleteTransientAlreadyDeletedNoJob() throws IOException {
         testDeleteTransientAlreadyDeleted(null);
     }
 
     @Test
-    public void testDeleteTransientAlreadyDeletedForJob() throws IOException {
+    void testDeleteTransientAlreadyDeletedForJob() throws IOException {
         testDeleteTransientAlreadyDeleted(new JobID());
     }
 
@@ -177,17 +166,11 @@ public class BlobCacheDeleteTest extends TestLogger {
      * @param jobId job id
      */
     private void testDeleteTransientAlreadyDeleted(@Nullable final JobID jobId) throws IOException {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -195,28 +178,28 @@ public class BlobCacheDeleteTest extends TestLogger {
 
             // put BLOB
             TransientBlobKey key = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
-            assertNotNull(key);
+            assertThat(key).isNotNull();
 
             File blobFile = server.getStorageLocation(jobId, key);
-            assertTrue(blobFile.delete());
+            assertThat(blobFile.delete()).isTrue();
 
             // DELETE operation should not fail if file is already deleted
-            assertTrue(delete(cache, jobId, key));
+            assertThat(delete(cache, jobId, key)).isTrue();
             verifyDeleted(cache, jobId, key);
 
             // one more delete call that should not fail
-            assertTrue(delete(cache, jobId, key));
+            assertThat(delete(cache, jobId, key)).isTrue();
             verifyDeleted(cache, jobId, key);
         }
     }
 
     @Test
-    public void testDeleteTransientLocalFailsNoJob() throws IOException, InterruptedException {
+    void testDeleteTransientLocalFailsNoJob() throws IOException, InterruptedException {
         testDeleteTransientLocalFails(null);
     }
 
     @Test
-    public void testDeleteTransientLocalFailsForJob() throws IOException, InterruptedException {
+    void testDeleteTransientLocalFailsForJob() throws IOException, InterruptedException {
         testDeleteTransientLocalFails(new JobID());
     }
 
@@ -229,20 +212,15 @@ public class BlobCacheDeleteTest extends TestLogger {
      */
     private void testDeleteTransientLocalFails(@Nullable final JobID jobId)
             throws IOException, InterruptedException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
+
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
-        final Configuration config = new Configuration();
         File blobFile = null;
         File directory = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             try {
@@ -251,7 +229,7 @@ public class BlobCacheDeleteTest extends TestLogger {
 
                 // put BLOB
                 TransientBlobKey key = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
-                assertNotNull(key);
+                assertThat(key).isNotNull();
 
                 // access from cache once to have it available there
                 verifyContents(cache, jobId, key, data);
@@ -259,11 +237,12 @@ public class BlobCacheDeleteTest extends TestLogger {
                 blobFile = cache.getTransientBlobService().getStorageLocation(jobId, key);
                 directory = blobFile.getParentFile();
 
-                assertTrue(blobFile.setWritable(false, false));
-                assertTrue(directory.setWritable(false, false));
+                assertThat(blobFile.setWritable(false, false)).isTrue();
+                assertThat(directory.setWritable(false, false)).isTrue();
 
                 // issue a DELETE request
-                assertFalse(delete(cache, jobId, key));
+
+                assertThat(delete(cache, jobId, key)).isFalse();
 
                 // the file should still be there on the cache
                 verifyContents(cache, jobId, key, data);
@@ -282,13 +261,13 @@ public class BlobCacheDeleteTest extends TestLogger {
     }
 
     @Test
-    public void testConcurrentDeleteOperationsNoJobTransient()
+    void testConcurrentDeleteOperationsNoJobTransient()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentDeleteOperations(null);
     }
 
     @Test
-    public void testConcurrentDeleteOperationsForJobTransient()
+    void testConcurrentDeleteOperationsForJobTransient()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentDeleteOperations(new JobID());
     }
@@ -306,7 +285,6 @@ public class BlobCacheDeleteTest extends TestLogger {
     private void testConcurrentDeleteOperations(@Nullable final JobID jobId)
             throws IOException, InterruptedException, ExecutionException {
 
-        final Configuration config = new Configuration();
         final int concurrentDeleteOperations = 3;
         final ExecutorService executor = Executors.newFixedThreadPool(concurrentDeleteOperations);
 
@@ -315,35 +293,30 @@ public class BlobCacheDeleteTest extends TestLogger {
 
         final byte[] data = {1, 2, 3};
 
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             final TransientBlobKey blobKey =
                     (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
 
-            assertTrue(server.getStorageLocation(jobId, blobKey).exists());
+            assertThat(server.getStorageLocation(jobId, blobKey)).exists();
 
             for (int i = 0; i < concurrentDeleteOperations; i++) {
                 CompletableFuture<Void> deleteFuture =
                         CompletableFuture.supplyAsync(
                                 () -> {
                                     try {
-                                        assertTrue(delete(cache, jobId, blobKey));
-                                        assertFalse(
-                                                cache.getTransientBlobService()
-                                                        .getStorageLocation(jobId, blobKey)
-                                                        .exists());
+                                        assertThat(delete(cache, jobId, blobKey)).isTrue();
+                                        assertThat(
+                                                        cache.getTransientBlobService()
+                                                                .getStorageLocation(jobId, blobKey))
+                                                .doesNotExist();
                                         // delete only works on local cache!
-                                        assertTrue(
-                                                server.getStorageLocation(jobId, blobKey).exists());
+                                        assertThat(server.getStorageLocation(jobId, blobKey))
+                                                .exists();
                                         return null;
                                     } catch (IOException e) {
                                         throw new CompletionException(
@@ -362,7 +335,7 @@ public class BlobCacheDeleteTest extends TestLogger {
             waitFuture.get();
 
             // delete only works on local cache!
-            assertTrue(server.getStorageLocation(jobId, blobKey).exists());
+            assertThat(server.getStorageLocation(jobId, blobKey)).exists();
 
         } finally {
             executor.shutdownNow();
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
index 513011c9505..c336a8264f8 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
@@ -19,28 +19,24 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
-import org.apache.flink.configuration.Configuration;
+import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
 import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.net.InetSocketAddress;
 import java.nio.file.AccessDeniedException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
@@ -64,14 +60,9 @@ import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
 import static org.apache.flink.runtime.blob.BlobUtils.JOB_DIR_PREFIX;
 import static org.apache.flink.runtime.blob.BlobUtils.NO_JOB_DIR_PREFIX;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /**
  * Tests for GET-specific parts of the {@link BlobCacheService}.
@@ -83,31 +74,29 @@ import static org.junit.Assume.assumeTrue;
  * <p>Most successful GET requests are tested in conjunction wit the PUT requests by {@link
  * BlobCachePutTest}.
  */
-public class BlobCacheGetTest extends TestLogger {
+class BlobCacheGetTest {
 
-    private final Random rnd = new Random();
-
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
-    @Rule public final ExpectedException exception = ExpectedException.none();
+    private final Random rnd = new Random();
 
     @Test
-    public void testGetTransientFailsDuringLookup1() throws IOException, InterruptedException {
+    void testGetTransientFailsDuringLookup1() throws IOException, InterruptedException {
         testGetFailsDuringLookup(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetTransientFailsDuringLookup2() throws IOException, InterruptedException {
+    void testGetTransientFailsDuringLookup2() throws IOException, InterruptedException {
         testGetFailsDuringLookup(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetTransientFailsDuringLookup3() throws IOException, InterruptedException {
+    void testGetTransientFailsDuringLookup3() throws IOException, InterruptedException {
         testGetFailsDuringLookup(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetFailsDuringLookupHa() throws IOException, InterruptedException {
+    void testGetFailsDuringLookupHa() throws IOException, InterruptedException {
         testGetFailsDuringLookup(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -121,17 +110,11 @@ public class BlobCacheGetTest extends TestLogger {
     private void testGetFailsDuringLookup(
             final JobID jobId1, final JobID jobId2, BlobKey.BlobType blobType)
             throws IOException, InterruptedException {
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -139,19 +122,19 @@ public class BlobCacheGetTest extends TestLogger {
 
             // put content addressable (like libraries)
             BlobKey key = put(server, jobId1, data, blobType);
-            assertNotNull(key);
+            assertThat(key).isNotNull();
             verifyType(blobType, key);
 
             // delete file to make sure that GET requests fail
             File blobFile = server.getStorageLocation(jobId1, key);
-            assertTrue(blobFile.delete());
+            assertThat(blobFile.delete()).isTrue();
 
             // issue a GET request that fails
             verifyDeleted(cache, jobId1, key);
 
             // add the same data under a second jobId
             BlobKey key2 = put(server, jobId2, data, blobType);
-            assertNotNull(key2);
+            assertThat(key2).isNotNull();
             verifyKeyDifferentHashEquals(key, key2);
 
             // request for jobId2 should succeed
@@ -161,25 +144,25 @@ public class BlobCacheGetTest extends TestLogger {
 
             if (blobType == PERMANENT_BLOB) {
                 // still existing on server
-                assertTrue(server.getStorageLocation(jobId2, key2).exists());
+                assertThat(server.getStorageLocation(jobId2, key2)).exists();
                 // delete jobId2 on cache
                 blobFile = cache.getPermanentBlobService().getStorageLocation(jobId2, key2);
-                assertTrue(blobFile.delete());
+                assertThat(blobFile.delete()).isTrue();
                 // try to retrieve again
                 get(cache, jobId2, key2);
 
                 // delete on cache and server, verify that it is not accessible anymore
                 blobFile = cache.getPermanentBlobService().getStorageLocation(jobId2, key2);
-                assertTrue(blobFile.delete());
+                assertThat(blobFile.delete()).isTrue();
                 blobFile = server.getStorageLocation(jobId2, key2);
-                assertTrue(blobFile.delete());
+                assertThat(blobFile.delete()).isTrue();
                 verifyDeleted(cache, jobId2, key2);
             } else {
                 // deleted eventually on the server by the GET request above
                 verifyDeletedEventually(server, jobId2, key2);
                 // delete jobId2 on cache
                 blobFile = cache.getTransientBlobService().getStorageLocation(jobId2, key2);
-                assertTrue(blobFile.delete());
+                assertThat(blobFile.delete()).isTrue();
                 // verify that it is not accessible anymore
                 verifyDeleted(cache, jobId2, key2);
             }
@@ -187,17 +170,17 @@ public class BlobCacheGetTest extends TestLogger {
     }
 
     @Test
-    public void testGetFailsIncomingNoJob() throws IOException {
+    void testGetFailsIncomingNoJob() throws IOException {
         testGetFailsIncoming(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetFailsIncomingForJob() throws IOException {
+    void testGetFailsIncomingForJob() throws IOException {
         testGetFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetFailsIncomingForJobHa() throws IOException {
+    void testGetFailsIncomingForJobHa() throws IOException {
         testGetFailsIncoming(new JobID(), PERMANENT_BLOB);
     }
 
@@ -210,19 +193,14 @@ public class BlobCacheGetTest extends TestLogger {
      */
     private void testGetFailsIncoming(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
-        final Configuration config = new Configuration();
-        File tempFileDir = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        File tempFileDir = null;
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // store the data on the server
@@ -239,45 +217,43 @@ public class BlobCacheGetTest extends TestLogger {
                 tempFileDir =
                         cache.getTransientBlobService().createTemporaryFilename().getParentFile();
             }
-            assertTrue(tempFileDir.setExecutable(true, false));
-            assertTrue(tempFileDir.setReadable(true, false));
-            assertTrue(tempFileDir.setWritable(false, false));
-
-            // request the file from the server via the cache
-            exception.expect(IOException.class);
-            exception.expectMessage("Failed to fetch BLOB ");
+            assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+            assertThat(tempFileDir.setReadable(true, false)).isTrue();
+            assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
             try {
-                get(cache, jobId, blobKey);
+                assertThatThrownBy(() -> get(cache, jobId, blobKey))
+                        .isInstanceOf(IOException.class)
+                        .hasMessageStartingWith("Failed to fetch BLOB");
             } finally {
                 HashSet<String> expectedDirs = new HashSet<>();
                 expectedDirs.add("incoming");
+
                 if (jobId != null) {
                     // only the incoming and job directory should exist (no job directory!)
                     expectedDirs.add(JOB_DIR_PREFIX + jobId);
-                    File storageDir = tempFileDir.getParentFile();
-                    String[] actualDirs = storageDir.list();
-                    assertNotNull(actualDirs);
-                    assertEquals(expectedDirs, new HashSet<>(Arrays.asList(actualDirs)));
 
                     // job directory should be empty
                     File jobDir = new File(tempFileDir.getParentFile(), JOB_DIR_PREFIX + jobId);
-                    assertArrayEquals(new String[] {}, jobDir.list());
+                    assertThat(jobDir.list()).isEmpty();
                 } else {
                     // only the incoming and no_job directory should exist (no job directory!)
                     expectedDirs.add(NO_JOB_DIR_PREFIX);
-                    File storageDir = tempFileDir.getParentFile();
-                    String[] actualDirs = storageDir.list();
-                    assertNotNull(actualDirs);
-                    assertEquals(expectedDirs, new HashSet<>(Arrays.asList(actualDirs)));
 
                     // no_job directory should be empty
                     File noJobDir = new File(tempFileDir.getParentFile(), NO_JOB_DIR_PREFIX);
-                    assertArrayEquals(new String[] {}, noJobDir.list());
+                    assertThat(noJobDir.list()).isEmpty();
                 }
 
+                File storageDir = tempFileDir.getParentFile();
+                String[] actualDirs = storageDir.list();
+                assertThat(actualDirs)
+                        .isNotNull()
+                        .isNotEmpty()
+                        .containsExactlyInAnyOrderElementsOf(expectedDirs);
+
                 // file should still be there on the server (even if transient)
-                assertTrue(server.getStorageLocation(jobId, blobKey).exists());
+                assertThat(server.getStorageLocation(jobId, blobKey)).exists();
             }
         } finally {
             // set writable again to make sure we can remove the directory
@@ -289,17 +265,17 @@ public class BlobCacheGetTest extends TestLogger {
     }
 
     @Test
-    public void testGetTransientFailsStoreNoJob() throws IOException, InterruptedException {
+    void testGetTransientFailsStoreNoJob() throws IOException, InterruptedException {
         testGetFailsStore(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetTransientFailsStoreForJob() throws IOException, InterruptedException {
+    void testGetTransientFailsStoreForJob() throws IOException, InterruptedException {
         testGetFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetPermanentFailsStoreForJob() throws IOException, InterruptedException {
+    void testGetPermanentFailsStoreForJob() throws IOException, InterruptedException {
         testGetFailsStore(new JobID(), PERMANENT_BLOB);
     }
 
@@ -312,18 +288,14 @@ public class BlobCacheGetTest extends TestLogger {
      */
     private void testGetFailsStore(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException, InterruptedException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
+
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
-        final Configuration config = new Configuration();
         File jobStoreDir = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
 
             server.start();
 
@@ -345,29 +317,27 @@ public class BlobCacheGetTest extends TestLogger {
                                 .getStorageLocation(jobId, new TransientBlobKey())
                                 .getParentFile();
             }
-            assertTrue(jobStoreDir.setExecutable(true, false));
-            assertTrue(jobStoreDir.setReadable(true, false));
-            assertTrue(jobStoreDir.setWritable(false, false));
-
-            // request the file from the server via the cache
-            exception.expect(AccessDeniedException.class);
+            assertThat(jobStoreDir.setExecutable(true, false)).isTrue();
+            assertThat(jobStoreDir.setReadable(true, false)).isTrue();
+            assertThat(jobStoreDir.setWritable(false, false)).isTrue();
 
             try {
-                get(cache, jobId, blobKey);
+                assertThatThrownBy(() -> get(cache, jobId, blobKey))
+                        .isInstanceOf(AccessDeniedException.class);
             } finally {
                 // there should be no remaining incoming files
                 File incomingFileDir = new File(jobStoreDir.getParent(), "incoming");
-                assertArrayEquals(new String[] {}, incomingFileDir.list());
+                assertThat(incomingFileDir.list()).isEmpty();
 
                 // there should be no files in the job directory
-                assertArrayEquals(new String[] {}, jobStoreDir.list());
+                assertThat(jobStoreDir.list()).isEmpty();
 
                 // if transient, the get will fail but since the download was successful, the file
                 // will not be on the server anymore
                 if (blobType == TRANSIENT_BLOB) {
                     verifyDeletedEventually(server, jobId, blobKey);
                 } else {
-                    assertTrue(server.getStorageLocation(jobId, blobKey).exists());
+                    assertThat(server.getStorageLocation(jobId, blobKey)).exists();
                 }
             }
         } finally {
@@ -384,35 +354,28 @@ public class BlobCacheGetTest extends TestLogger {
      * the file. File transfers should fail.
      */
     @Test
-    public void testGetFailsHaStoreForJobHa() throws IOException {
+    void testGetFailsHaStoreForJobHa() throws IOException {
         final JobID jobId = new JobID();
 
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // store the data on the server (and blobStore), remove from local server store
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
             PermanentBlobKey blobKey = (PermanentBlobKey) put(server, jobId, data, PERMANENT_BLOB);
-            assertTrue(server.getStorageLocation(jobId, blobKey).delete());
+            assertThat(server.getStorageLocation(jobId, blobKey).delete()).isTrue();
 
             File tempFileDir = server.createTemporaryFilename().getParentFile();
 
-            // request the file from the server via the cache
-            exception.expect(IOException.class);
-            exception.expectMessage("Failed to fetch BLOB ");
-
             try {
-                get(cache, jobId, blobKey);
+                assertThatThrownBy(() -> get(cache, jobId, blobKey))
+                        .isInstanceOf(IOException.class)
+                        .hasMessageStartingWith("Failed to fetch BLOB");
             } finally {
                 HashSet<String> expectedDirs = new HashSet<>();
                 expectedDirs.add("incoming");
@@ -420,23 +383,25 @@ public class BlobCacheGetTest extends TestLogger {
                 // only the incoming and job directory should exist (no job directory!)
                 File storageDir = tempFileDir.getParentFile();
                 String[] actualDirs = storageDir.list();
-                assertNotNull(actualDirs);
-                assertEquals(expectedDirs, new HashSet<>(Arrays.asList(actualDirs)));
+                assertThat(actualDirs)
+                        .isNotNull()
+                        .isNotEmpty()
+                        .containsExactlyInAnyOrderElementsOf(expectedDirs);
 
                 // job directory should be empty
                 File jobDir = new File(tempFileDir.getParentFile(), JOB_DIR_PREFIX + jobId);
-                assertArrayEquals(new String[] {}, jobDir.list());
+                assertThat(jobDir.list()).isEmpty();
             }
         }
     }
 
     @Test
-    public void testGetTransientRemoteDeleteFailsNoJob() throws IOException {
+    void testGetTransientRemoteDeleteFailsNoJob() throws IOException {
         testGetTransientRemoteDeleteFails(null);
     }
 
     @Test
-    public void testGetTransientRemoteDeleteFailsForJob() throws IOException {
+    void testGetTransientRemoteDeleteFailsForJob() throws IOException {
         testGetTransientRemoteDeleteFails(new JobID());
     }
 
@@ -449,21 +414,15 @@ public class BlobCacheGetTest extends TestLogger {
      * @param jobId job id
      */
     private void testGetTransientRemoteDeleteFails(@Nullable final JobID jobId) throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
+
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
-        final Configuration config = new Configuration();
         File blobFile = null;
         File directory = null;
-
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
-
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             try {
@@ -472,21 +431,21 @@ public class BlobCacheGetTest extends TestLogger {
 
                 // put BLOB
                 TransientBlobKey key = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
-                assertNotNull(key);
+                assertThat(key).isNotNull();
 
                 blobFile = server.getStorageLocation(jobId, key);
                 directory = blobFile.getParentFile();
 
-                assertTrue(blobFile.setWritable(false, false));
-                assertTrue(directory.setWritable(false, false));
+                assertThat(blobFile.setWritable(false, false)).isTrue();
+                assertThat(directory.setWritable(false, false)).isTrue();
 
                 // access from cache once which also deletes the file on the server
                 verifyContents(cache, jobId, key, data);
                 // delete locally (should not be affected by the server)
-                assertTrue(delete(cache, jobId, key));
+                assertThat(delete(cache, jobId, key)).isTrue();
                 File blobFileAtCache =
                         cache.getTransientBlobService().getStorageLocation(jobId, key);
-                assertFalse(blobFileAtCache.exists());
+                assertThat(blobFileAtCache).doesNotExist();
 
                 // the file should still be there on the server
                 verifyContents(server, jobId, key, data);
@@ -510,25 +469,25 @@ public class BlobCacheGetTest extends TestLogger {
      * blob.
      */
     @Test
-    public void testConcurrentGetOperationsNoJob()
+    void testConcurrentGetOperationsNoJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(null, TRANSIENT_BLOB, false);
     }
 
     @Test
-    public void testConcurrentGetOperationsForJob()
+    void testConcurrentGetOperationsForJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(new JobID(), TRANSIENT_BLOB, false);
     }
 
     @Test
-    public void testConcurrentGetOperationsForJobHa()
+    void testConcurrentGetOperationsForJobHa()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(new JobID(), PERMANENT_BLOB, false);
     }
 
     @Test
-    public void testConcurrentGetOperationsForJobHa2()
+    void testConcurrentGetOperationsForJobHa2()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(new JobID(), PERMANENT_BLOB, true);
     }
@@ -545,7 +504,7 @@ public class BlobCacheGetTest extends TestLogger {
     private void testConcurrentGetOperations(
             final JobID jobId, final BlobKey.BlobType blobType, final boolean cacheAccessesHAStore)
             throws IOException, InterruptedException, ExecutionException {
-        final Configuration config = new Configuration();
+
         final BlobStore blobStoreServer = new VoidBlobStore();
         final BlobStore blobStoreCache = new VoidBlobStore();
 
@@ -558,15 +517,14 @@ public class BlobCacheGetTest extends TestLogger {
         final ExecutorService executor =
                 Executors.newFixedThreadPool(numberConcurrentGetOperations);
 
-        try (final BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), blobStoreServer);
-                final BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                cacheAccessesHAStore ? blobStoreServer : blobStoreCache,
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(
+                        tempDir,
+                        blobStoreServer,
+                        cacheAccessesHAStore ? blobStoreServer : blobStoreCache);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // upload data first
@@ -581,7 +539,8 @@ public class BlobCacheGetTest extends TestLogger {
                                     try {
                                         File file = get(cache, jobId, blobKey);
                                         // check that we have read the right data
-                                        validateGetAndClose(new FileInputStream(file), data);
+                                        validateGetAndClose(
+                                                Files.newInputStream(file.toPath()), data);
                                         return file;
                                     } catch (IOException e) {
                                         throw new CompletionException(
@@ -623,7 +582,7 @@ public class BlobCacheGetTest extends TestLogger {
                 }
                 // multiple clients may have accessed the BLOB successfully before it was
                 // deleted, but always at least one:
-                assertThat(completedSuccessfully, greaterThanOrEqualTo(1));
+                assertThat(completedSuccessfully).isGreaterThanOrEqualTo(1);
             }
         } finally {
             executor.shutdownNow();
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
index f5cb95da84a..ce76e50901b 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
@@ -19,19 +19,17 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
+import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.core.testutils.CheckedThread;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
 import org.apache.commons.io.FileUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
@@ -58,19 +56,17 @@ import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
 import static org.apache.flink.runtime.blob.BlobKeyTest.verifyType;
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFilesExist;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.BlockingInputStream;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.ChunkedInputStream;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFilesExist;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assumptions.assumeThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -79,18 +75,16 @@ import static org.mockito.Mockito.verify;
  * Tests for successful and failing PUT operations against the BLOB server, and successful GET
  * operations.
  */
-public class BlobCachePutTest extends TestLogger {
+class BlobCachePutTest {
 
-    private final Random rnd = new Random();
-
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private java.nio.file.Path tempDir;
 
-    @Rule public final ExpectedException exception = ExpectedException.none();
+    private final Random rnd = new Random();
 
     // --- concurrency tests for utility methods which could fail during the put operation ---
 
     /** Checked thread that calls {@link TransientBlobCache#getStorageLocation(JobID, BlobKey)}. */
-    public static class TransientBlobCacheGetStorageLocation extends CheckedThread {
+    private static class TransientBlobCacheGetStorageLocation extends CheckedThread {
         private final TransientBlobCache cache;
         private final JobID jobId;
         private final BlobKey key;
@@ -109,7 +103,7 @@ public class BlobCachePutTest extends TestLogger {
     }
 
     /** Checked thread that calls {@link PermanentBlobCache#getStorageLocation(JobID, BlobKey)}. */
-    public static class PermanentBlobCacheGetStorageLocation extends CheckedThread {
+    private static class PermanentBlobCacheGetStorageLocation extends CheckedThread {
         private final PermanentBlobCache cache;
         private final JobID jobId;
         private final BlobKey key;
@@ -128,26 +122,21 @@ public class BlobCachePutTest extends TestLogger {
 
     /** Tests concurrent calls to {@link TransientBlobCache#getStorageLocation(JobID, BlobKey)}. */
     @Test
-    public void testTransientBlobCacheGetStorageLocationConcurrentNoJob() throws Exception {
+    void testTransientBlobCacheGetStorageLocationConcurrentNoJob() throws Exception {
         testTransientBlobCacheGetStorageLocationConcurrent(null);
     }
 
     /** Tests concurrent calls to {@link TransientBlobCache#getStorageLocation(JobID, BlobKey)}. */
     @Test
-    public void testTransientBlobCacheGetStorageLocationConcurrentForJob() throws Exception {
+    void testTransientBlobCacheGetStorageLocationConcurrentForJob() throws Exception {
         testTransientBlobCacheGetStorageLocationConcurrent(new JobID());
     }
 
     private void testTransientBlobCacheGetStorageLocationConcurrent(@Nullable final JobID jobId)
             throws Exception {
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                final TransientBlobCache cache =
-                        new TransientBlobCache(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir);
+                TransientBlobCache cache = TestingBlobUtils.createTransientCache(tempDir, server)) {
 
             server.start();
 
@@ -164,17 +153,10 @@ public class BlobCachePutTest extends TestLogger {
 
     /** Tests concurrent calls to {@link PermanentBlobCache#getStorageLocation(JobID, BlobKey)}. */
     @Test
-    public void testPermanentBlobCacheGetStorageLocationConcurrentForJob() throws Exception {
+    void testPermanentBlobCacheGetStorageLocationConcurrentForJob() throws Exception {
         final JobID jobId = new JobID();
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                final PermanentBlobCache cache =
-                        new PermanentBlobCache(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir);
+                PermanentBlobCache cache = TestingBlobUtils.createPermanentCache(tempDir, server)) {
 
             server.start();
 
@@ -211,27 +193,27 @@ public class BlobCachePutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutBufferTransientSuccessfulGet1() throws IOException, InterruptedException {
+    void testPutBufferTransientSuccessfulGet1() throws IOException, InterruptedException {
         testPutBufferSuccessfulGet(null, null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferTransientSuccessfulGet2() throws IOException, InterruptedException {
+    void testPutBufferTransientSuccessfulGet2() throws IOException, InterruptedException {
         testPutBufferSuccessfulGet(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferTransientSuccessfulGet3() throws IOException, InterruptedException {
+    void testPutBufferTransientSuccessfulGet3() throws IOException, InterruptedException {
         testPutBufferSuccessfulGet(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferTransientSuccessfulGet4() throws IOException, InterruptedException {
+    void testPutBufferTransientSuccessfulGet4() throws IOException, InterruptedException {
         testPutBufferSuccessfulGet(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferPermanentSuccessfulGet() throws IOException, InterruptedException {
+    void testPutBufferPermanentSuccessfulGet() throws IOException, InterruptedException {
         testPutBufferSuccessfulGet(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -247,17 +229,11 @@ public class BlobCachePutTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2, BlobKey.BlobType blobType)
             throws IOException, InterruptedException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -266,16 +242,16 @@ public class BlobCachePutTest extends TestLogger {
 
             // put data for jobId1 and verify
             BlobKey key1a = put(cache, jobId1, data, blobType);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             verifyType(blobType, key1a);
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(cache, jobId1, data, blobType);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyType(blobType, key1a2);
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             BlobKey key1b = put(cache, jobId1, data2, blobType);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
             verifyType(blobType, key1b);
 
             // files should be available on the server
@@ -285,12 +261,12 @@ public class BlobCachePutTest extends TestLogger {
 
             // now put data for jobId2 and verify that both are ok
             BlobKey key2a = put(cache, jobId2, data, blobType);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyType(blobType, key2a);
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             BlobKey key2b = put(cache, jobId2, data2, blobType);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyType(blobType, key2b);
             verifyKeyDifferentHashEquals(key1b, key2b);
 
@@ -332,22 +308,22 @@ public class BlobCachePutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutStreamTransientSuccessfulGet1() throws IOException, InterruptedException {
+    void testPutStreamTransientSuccessfulGet1() throws IOException, InterruptedException {
         testPutStreamTransientSuccessfulGet(null, null);
     }
 
     @Test
-    public void testPutStreamTransientSuccessfulGet2() throws IOException, InterruptedException {
+    void testPutStreamTransientSuccessfulGet2() throws IOException, InterruptedException {
         testPutStreamTransientSuccessfulGet(null, new JobID());
     }
 
     @Test
-    public void testPutStreamTransientSuccessfulGet3() throws IOException, InterruptedException {
+    void testPutStreamTransientSuccessfulGet3() throws IOException, InterruptedException {
         testPutStreamTransientSuccessfulGet(new JobID(), new JobID());
     }
 
     @Test
-    public void testPutStreamTransientSuccessfulGet4() throws IOException, InterruptedException {
+    void testPutStreamTransientSuccessfulGet4() throws IOException, InterruptedException {
         testPutStreamTransientSuccessfulGet(new JobID(), null);
     }
 
@@ -364,16 +340,11 @@ public class BlobCachePutTest extends TestLogger {
     private void testPutStreamTransientSuccessfulGet(@Nullable JobID jobId1, @Nullable JobID jobId2)
             throws IOException, InterruptedException {
 
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -384,16 +355,16 @@ public class BlobCachePutTest extends TestLogger {
             TransientBlobKey key1a =
                     (TransientBlobKey)
                             put(cache, jobId1, new ByteArrayInputStream(data), TRANSIENT_BLOB);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(cache, jobId1, new ByteArrayInputStream(data), TRANSIENT_BLOB);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             TransientBlobKey key1b =
                     (TransientBlobKey)
                             put(cache, jobId1, new ByteArrayInputStream(data2), TRANSIENT_BLOB);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
 
             // files should be available on the server
             verifyContents(server, jobId1, key1a, data);
@@ -404,13 +375,13 @@ public class BlobCachePutTest extends TestLogger {
             TransientBlobKey key2a =
                     (TransientBlobKey)
                             put(cache, jobId2, new ByteArrayInputStream(data), TRANSIENT_BLOB);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             TransientBlobKey key2b =
                     (TransientBlobKey)
                             put(cache, jobId2, new ByteArrayInputStream(data2), TRANSIENT_BLOB);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyKeyDifferentHashEquals(key1b, key2b);
 
             // verify the accessibility and the BLOB contents
@@ -443,26 +414,22 @@ public class BlobCachePutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutChunkedStreamTransientSuccessfulGet1()
-            throws IOException, InterruptedException {
+    void testPutChunkedStreamTransientSuccessfulGet1() throws IOException, InterruptedException {
         testPutChunkedStreamTransientSuccessfulGet(null, null);
     }
 
     @Test
-    public void testPutChunkedStreamTransientSuccessfulGet2()
-            throws IOException, InterruptedException {
+    void testPutChunkedStreamTransientSuccessfulGet2() throws IOException, InterruptedException {
         testPutChunkedStreamTransientSuccessfulGet(null, new JobID());
     }
 
     @Test
-    public void testPutChunkedStreamTransientSuccessfulGet3()
-            throws IOException, InterruptedException {
+    void testPutChunkedStreamTransientSuccessfulGet3() throws IOException, InterruptedException {
         testPutChunkedStreamTransientSuccessfulGet(new JobID(), new JobID());
     }
 
     @Test
-    public void testPutChunkedStreamTransientSuccessfulGet4()
-            throws IOException, InterruptedException {
+    void testPutChunkedStreamTransientSuccessfulGet4() throws IOException, InterruptedException {
         testPutChunkedStreamTransientSuccessfulGet(new JobID(), null);
     }
 
@@ -480,16 +447,11 @@ public class BlobCachePutTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2)
             throws IOException, InterruptedException {
 
-        final Configuration config = new Configuration();
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -500,16 +462,16 @@ public class BlobCachePutTest extends TestLogger {
             TransientBlobKey key1a =
                     (TransientBlobKey)
                             put(cache, jobId1, new ChunkedInputStream(data, 19), TRANSIENT_BLOB);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(cache, jobId1, new ChunkedInputStream(data, 19), TRANSIENT_BLOB);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             TransientBlobKey key1b =
                     (TransientBlobKey)
                             put(cache, jobId1, new ChunkedInputStream(data2, 19), TRANSIENT_BLOB);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
 
             // files should be available on the server
             verifyContents(server, jobId1, key1a, data);
@@ -520,13 +482,13 @@ public class BlobCachePutTest extends TestLogger {
             TransientBlobKey key2a =
                     (TransientBlobKey)
                             put(cache, jobId2, new ChunkedInputStream(data, 19), TRANSIENT_BLOB);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             TransientBlobKey key2b =
                     (TransientBlobKey)
                             put(cache, jobId2, new ChunkedInputStream(data2, 19), TRANSIENT_BLOB);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyKeyDifferentHashEquals(key1b, key2b);
 
             // verify the accessibility and the BLOB contents
@@ -559,17 +521,17 @@ public class BlobCachePutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutBufferFailsNoJob() throws IOException {
+    void testPutBufferFailsNoJob() throws IOException {
         testPutBufferFails(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsForJob() throws IOException {
+    void testPutBufferFailsForJob() throws IOException {
         testPutBufferFails(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsForJobHa() throws IOException {
+    void testPutBufferFailsForJobHa() throws IOException {
         testPutBufferFails(new JobID(), PERMANENT_BLOB);
     }
 
@@ -582,57 +544,44 @@ public class BlobCachePutTest extends TestLogger {
      */
     private void testPutBufferFails(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
-        final Configuration config = new Configuration();
-        File tempFileDir = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
-            tempFileDir = server.createTemporaryFilename().getParentFile().getParentFile();
-            assertTrue(tempFileDir.setExecutable(true, false));
-            assertTrue(tempFileDir.setReadable(true, false));
-            assertTrue(tempFileDir.setWritable(false, false));
+            File tempFileDir = server.createTemporaryFilename().getParentFile().getParentFile();
+            assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+            assertThat(tempFileDir.setReadable(true, false)).isTrue();
+            assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
-            // upload the file to the server via the cache
-            exception.expect(IOException.class);
-            exception.expectMessage("PUT operation failed: ");
+            assertThatThrownBy(() -> put(cache, jobId, data, blobType))
+                    .isInstanceOf(IOException.class)
+                    .hasMessageStartingWith("PUT operation failed: ");
 
-            put(cache, jobId, data, blobType);
-
-        } finally {
-            // set writable again to make sure we can remove the directory
-            if (tempFileDir != null) {
-                //noinspection ResultOfMethodCallIgnored
-                tempFileDir.setWritable(true, false);
-            }
+            assertThat(tempFileDir.setWritable(true, false)).isTrue();
         }
     }
 
     @Test
-    public void testPutBufferFailsIncomingNoJob() throws IOException {
+    void testPutBufferFailsIncomingNoJob() throws IOException {
         testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsIncomingForJob() throws IOException {
+    void testPutBufferFailsIncomingForJob() throws IOException {
         testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsIncomingForJobHa() throws IOException {
+    void testPutBufferFailsIncomingForJobHa() throws IOException {
         testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
     }
 
@@ -645,40 +594,33 @@ public class BlobCachePutTest extends TestLogger {
      */
     private void testPutBufferFailsIncoming(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
-        final Configuration config = new Configuration();
-        File tempFileDir = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        File tempFileDir = null;
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
             tempFileDir = server.createTemporaryFilename().getParentFile();
-            assertTrue(tempFileDir.setExecutable(true, false));
-            assertTrue(tempFileDir.setReadable(true, false));
-            assertTrue(tempFileDir.setWritable(false, false));
+            assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+            assertThat(tempFileDir.setReadable(true, false)).isTrue();
+            assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
-            // upload the file to the server via the cache
-            exception.expect(IOException.class);
-            exception.expectMessage("PUT operation failed: ");
-
             try {
-                put(cache, jobId, data, blobType);
+                assertThatThrownBy(() -> put(cache, jobId, data, blobType))
+                        .isInstanceOf(IOException.class)
+                        .hasMessageStartingWith("PUT operation failed: ");
             } finally {
                 File storageDir = tempFileDir.getParentFile();
                 // only the incoming directory should exist (no job directory!)
-                assertArrayEquals(new String[] {"incoming"}, storageDir.list());
+                assertThat(storageDir.list()).containsExactly("incoming");
             }
         } finally {
             // set writable again to make sure we can remove the directory
@@ -690,17 +632,17 @@ public class BlobCachePutTest extends TestLogger {
     }
 
     @Test
-    public void testPutBufferFailsStoreNoJob() throws IOException {
+    void testPutBufferFailsStoreNoJob() throws IOException {
         testPutBufferFailsStore(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsStoreForJob() throws IOException {
+    void testPutBufferFailsStoreForJob() throws IOException {
         testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsStoreForJobHa() throws IOException {
+    void testPutBufferFailsStoreForJobHa() throws IOException {
         testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
     }
 
@@ -713,44 +655,37 @@ public class BlobCachePutTest extends TestLogger {
      */
     private void testPutBufferFailsStore(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
-        final Configuration config = new Configuration();
-        File jobStoreDir = null;
-        try (BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir);
 
+        File jobStoreDir = null;
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
             jobStoreDir =
                     server.getStorageLocation(jobId, BlobKey.createKey(blobType)).getParentFile();
-            assertTrue(jobStoreDir.setExecutable(true, false));
-            assertTrue(jobStoreDir.setReadable(true, false));
-            assertTrue(jobStoreDir.setWritable(false, false));
+            assertThat(jobStoreDir.setExecutable(true, false)).isTrue();
+            assertThat(jobStoreDir.setReadable(true, false)).isTrue();
+            assertThat(jobStoreDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
-            // upload the file to the server via the cache
-            exception.expect(IOException.class);
-            exception.expectMessage("PUT operation failed: ");
-
             try {
-                put(cache, jobId, data, blobType);
+                assertThatThrownBy(() -> put(cache, jobId, data, blobType))
+                        .isInstanceOf(IOException.class)
+                        .hasMessageStartingWith("PUT operation failed: ");
             } finally {
                 // there should be no remaining incoming files
                 File incomingFileDir = new File(jobStoreDir.getParent(), "incoming");
-                assertArrayEquals(new String[] {}, incomingFileDir.list());
+                assertThat(incomingFileDir.list()).isEmpty();
 
                 // there should be no files in the job directory
-                assertArrayEquals(new String[] {}, jobStoreDir.list());
+                assertThat(jobStoreDir.list()).isEmpty();
             }
         } finally {
             // set writable again to make sure we can remove the directory
@@ -762,19 +697,19 @@ public class BlobCachePutTest extends TestLogger {
     }
 
     @Test
-    public void testConcurrentPutOperationsNoJob()
+    void testConcurrentPutOperationsNoJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentPutOperationsForJob()
+    void testConcurrentPutOperationsForJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentPutOperationsForJobHa()
+    void testConcurrentPutOperationsForJobHa()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(new JobID(), PERMANENT_BLOB);
     }
@@ -802,7 +737,7 @@ public class BlobCachePutTest extends TestLogger {
         final List<Path> jars;
         if (blobType == PERMANENT_BLOB) {
             // implement via JAR file upload instead:
-            File tmpFile = temporaryFolder.newFile();
+            File tmpFile = new File(tempDir.toFile(), "test_file");
             FileUtils.writeByteArrayToFile(tmpFile, data);
             jars = Collections.singletonList(new Path(tmpFile.getAbsolutePath()));
         } else {
@@ -814,15 +749,11 @@ public class BlobCachePutTest extends TestLogger {
 
         ExecutorService executor = Executors.newFixedThreadPool(concurrentPutOperations);
 
-        try (final BlobServer server =
-                        new BlobServer(config, temporaryFolder.newFolder(), blobStoreServer);
-                final BlobCacheService cache =
-                        new BlobCacheService(
-                                config,
-                                temporaryFolder.newFolder(),
-                                blobStoreCache,
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createServerAndCache(tempDir, blobStoreServer, blobStoreCache);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // for highAvailability
@@ -840,7 +771,7 @@ public class BlobCachePutTest extends TestLogger {
                                     List<PermanentBlobKey> keys =
                                             BlobClient.uploadFiles(
                                                     serverAddress, config, jobId, jars);
-                                    assertEquals(1, keys.size());
+                                    assertThat(keys).hasSize(1);
                                     BlobKey uploadedKey = keys.get(0);
                                     // check the uploaded file's contents (concurrently)
                                     verifyContents(server, jobId, uploadedKey, data);
@@ -881,7 +812,7 @@ public class BlobCachePutTest extends TestLogger {
 
             Iterator<BlobKey> blobKeyIterator = blobKeys.iterator();
 
-            assertTrue(blobKeyIterator.hasNext());
+            assertThat(blobKeyIterator).hasNext();
 
             BlobKey blobKey = blobKeyIterator.next();
 
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRecoveryTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRecoveryTest.java
index 8912a85687b..23012cc7d57 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRecoveryTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRecoveryTest.java
@@ -18,135 +18,41 @@
 
 package org.apache.flink.runtime.blob;
 
-import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.core.fs.FileSystem;
-import org.apache.flink.core.fs.Path;
 import org.apache.flink.runtime.jobmanager.HighAvailabilityMode;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.Random;
-
-import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashDifferent;
-import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
-import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 /** Tests for the recovery of files of a {@link BlobCacheService} from a HA store. */
-public class BlobCacheRecoveryTest extends TestLogger {
+public class BlobCacheRecoveryTest {
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir private java.nio.file.Path tempDir;
 
     /**
      * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed JARs are recoverable from
      * any participating BlobServer.
      */
     @Test
-    public void testBlobCacheRecovery() throws Exception {
+    void testBlobCacheRecovery() throws Exception {
         Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStoreService = null;
 
         try {
             blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
-            testBlobCacheRecovery(config, blobStoreService, TEMPORARY_FOLDER.newFolder());
+            TestingBlobHelpers.testBlobCacheRecovery(
+                    config, blobStoreService, TempDirUtils.newFolder(tempDir));
         } finally {
             if (blobStoreService != null) {
                 blobStoreService.closeAndCleanupAllData();
             }
         }
     }
-
-    /**
-     * Helper to test that the {@link BlobServer} recovery from its HA store works.
-     *
-     * <p>Uploads two BLOBs to one {@link BlobServer} via a {@link BlobCacheService} and expects a
-     * second {@link BlobCacheService} to be able to retrieve them from a second {@link BlobServer}
-     * that is configured with the same HA store.
-     *
-     * @param config blob server configuration (including HA settings like {@link
-     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
-     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
-     * @param blobStore shared HA blob store to use
-     * @throws IOException in case of failures
-     */
-    public static void testBlobCacheRecovery(
-            final Configuration config, final BlobStore blobStore, final File blobStorage)
-            throws IOException {
-
-        final String clusterId = config.getString(HighAvailabilityOptions.HA_CLUSTER_ID);
-        String storagePath =
-                config.getString(HighAvailabilityOptions.HA_STORAGE_PATH) + "/" + clusterId;
-        Random rand = new Random();
-
-        try (BlobServer server0 =
-                        new BlobServer(config, new File(blobStorage, "server0"), blobStore);
-                BlobServer server1 =
-                        new BlobServer(config, new File(blobStorage, "server1"), blobStore);
-                // use VoidBlobStore as the HA store to force download from each server's HA store
-                BlobCacheService cache0 =
-                        new BlobCacheService(
-                                config,
-                                new File(blobStorage, "cache0"),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server0.getPort()));
-                BlobCacheService cache1 =
-                        new BlobCacheService(
-                                config,
-                                new File(blobStorage, "cache1"),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server1.getPort()))) {
-
-            server0.start();
-            server1.start();
-
-            // Random data
-            byte[] expected = new byte[1024];
-            rand.nextBytes(expected);
-            byte[] expected2 = Arrays.copyOfRange(expected, 32, 288);
-
-            BlobKey[] keys = new BlobKey[2];
-            BlobKey nonHAKey;
-
-            // Put job-related HA data
-            JobID[] jobId = new JobID[] {new JobID(), new JobID()};
-            keys[0] = put(cache0, jobId[0], expected, PERMANENT_BLOB); // Request 1
-            keys[1] = put(cache0, jobId[1], expected2, PERMANENT_BLOB); // Request 2
-
-            // put non-HA data
-            nonHAKey = put(cache0, jobId[0], expected2, TRANSIENT_BLOB);
-            verifyKeyDifferentHashDifferent(keys[0], nonHAKey);
-            verifyKeyDifferentHashEquals(keys[1], nonHAKey);
-
-            // check that the storage directory exists
-            final Path blobServerPath = new Path(storagePath, "blob");
-            FileSystem fs = blobServerPath.getFileSystem();
-            assertTrue("Unknown storage dir: " + blobServerPath, fs.exists(blobServerPath));
-
-            // Verify HA requests from cache1 (connected to server1) with no immediate access to the
-            // file
-            verifyContents(cache1, jobId[0], keys[0], expected);
-            verifyContents(cache1, jobId[1], keys[1], expected2);
-
-            // Verify non-HA file is not accessible from server1
-            verifyDeleted(cache1, jobId[0], nonHAKey);
-        }
-    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRetriesTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRetriesTest.java
index 2e08da7284c..94e6d5bdc9b 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRetriesTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheRetriesTest.java
@@ -19,36 +19,36 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
+import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.IOException;
-import java.net.InetSocketAddress;
+import java.nio.file.Path;
 
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Unit tests for the blob cache retrying the connection to the server. */
-public class BlobCacheRetriesTest extends TestLogger {
+class BlobCacheRetriesTest {
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     /**
      * A test where the connection fails twice and then the get operation succeeds (job-unrelated
      * blob).
      */
     @Test
-    public void testBlobFetchRetries() throws IOException {
+    void testBlobFetchRetries() throws IOException {
         testBlobFetchRetries(new VoidBlobStore(), null, TRANSIENT_BLOB);
     }
 
@@ -57,7 +57,7 @@ public class BlobCacheRetriesTest extends TestLogger {
      * blob).
      */
     @Test
-    public void testBlobForJobFetchRetries() throws IOException {
+    void testBlobForJobFetchRetries() throws IOException {
         testBlobFetchRetries(new VoidBlobStore(), new JobID(), TRANSIENT_BLOB);
     }
 
@@ -66,11 +66,11 @@ public class BlobCacheRetriesTest extends TestLogger {
      * availability set, job-related job).
      */
     @Test
-    public void testBlobFetchRetriesHa() throws IOException {
+    void testBlobFetchRetriesHa() throws IOException {
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStoreService = null;
 
@@ -91,24 +91,16 @@ public class BlobCacheRetriesTest extends TestLogger {
      *
      * @param blobType whether the BLOB should become permanent or transient
      */
-    private static void testBlobFetchRetries(
+    private void testBlobFetchRetries(
             final BlobStore blobStore, @Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-
-        final Configuration configuration = new Configuration();
-
         final byte[] data = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
 
-        try (BlobServer server =
-                        new TestingFailingBlobServer(
-                                configuration, TEMPORARY_FOLDER.newFolder(), blobStore, 2);
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                configuration,
-                                TEMPORARY_FOLDER.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createFailingServerAndCache(tempDir, blobStore, 1, 2);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // upload some blob
@@ -125,7 +117,7 @@ public class BlobCacheRetriesTest extends TestLogger {
      * (job-unrelated blob).
      */
     @Test
-    public void testBlobNoJobFetchWithTooManyFailures() throws IOException {
+    void testBlobNoJobFetchWithTooManyFailures() throws IOException {
         testBlobFetchWithTooManyFailures(new VoidBlobStore(), null, TRANSIENT_BLOB);
     }
 
@@ -134,7 +126,7 @@ public class BlobCacheRetriesTest extends TestLogger {
      * blob).
      */
     @Test
-    public void testBlobForJobFetchWithTooManyFailures() throws IOException {
+    void testBlobForJobFetchWithTooManyFailures() throws IOException {
         testBlobFetchWithTooManyFailures(new VoidBlobStore(), new JobID(), TRANSIENT_BLOB);
     }
 
@@ -143,11 +135,10 @@ public class BlobCacheRetriesTest extends TestLogger {
      * availability set, job-related blob).
      */
     @Test
-    public void testBlobForJobFetchWithTooManyFailuresHa() throws IOException {
+    void testBlobForJobFetchWithTooManyFailuresHa() throws IOException {
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
-        config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.getRoot().getPath());
+        config.setString(HighAvailabilityOptions.HA_STORAGE_PATH, tempDir.toString());
 
         BlobStoreService blobStoreService = null;
 
@@ -168,35 +159,24 @@ public class BlobCacheRetriesTest extends TestLogger {
      *
      * @param blobType whether the BLOB should become permanent or transient
      */
-    private static void testBlobFetchWithTooManyFailures(
+    private void testBlobFetchWithTooManyFailures(
             final BlobStore blobStore, @Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        final Configuration configuration = new Configuration();
-
         final byte[] data = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
 
-        try (BlobServer server =
-                        new TestingFailingBlobServer(
-                                configuration, TEMPORARY_FOLDER.newFolder(), blobStore, 0, 10);
-                BlobCacheService cache =
-                        new BlobCacheService(
-                                configuration,
-                                TEMPORARY_FOLDER.newFolder(),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server.getPort()))) {
+        Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                TestingBlobUtils.createFailingServerAndCache(tempDir, blobStore, 0, 10);
 
+        try (BlobServer server = serverAndCache.f0;
+                BlobCacheService cache = serverAndCache.f1) {
             server.start();
 
             // upload some blob
             final BlobKey key = put(server, jobId, data, blobType);
 
             // trigger a download - it should fail eventually
-            try {
-                verifyContents(cache, jobId, key, data);
-                fail("This should fail");
-            } catch (IOException e) {
-                // as we expected
-            }
+            assertThatThrownBy(() -> verifyContents(cache, jobId, key, data))
+                    .isInstanceOf(IOException.class);
         }
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSizeTrackerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSizeTrackerTest.java
index f8d6424f98c..8684738afcc 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSizeTrackerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSizeTrackerTest.java
@@ -21,29 +21,25 @@ package org.apache.flink.runtime.blob;
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.runtime.blob.BlobKey.BlobType;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for {@link BlobCacheSizeTracker}. */
-public class BlobCacheSizeTrackerTest extends TestLogger {
+class BlobCacheSizeTrackerTest {
 
     private BlobCacheSizeTracker tracker;
     private JobID jobId;
     private BlobKey blobKey;
 
-    @Before
-    public void setup() {
+    @BeforeEach
+    void setup() {
         tracker = new BlobCacheSizeTracker(5L);
         jobId = new JobID();
         blobKey = BlobKey.createKey(BlobType.PERMANENT_BLOB);
@@ -52,31 +48,32 @@ public class BlobCacheSizeTrackerTest extends TestLogger {
     }
 
     @Test
-    public void testCheckLimit() {
+    void testCheckLimit() {
         List<Tuple2<JobID, BlobKey>> keys = tracker.checkLimit(3L);
 
-        assertEquals(1, keys.size());
-        assertEquals(jobId, keys.get(0).f0);
-        assertEquals(blobKey, keys.get(0).f1);
+        assertThat(keys).hasSize(1);
+        assertThat(keys.get(0).f0).isEqualTo(jobId);
+        assertThat(keys.get(0).f1).isEqualTo(blobKey);
     }
 
     /** If an empty BLOB is intended to be stored, no BLOBs should be removed. */
     @Test
-    public void testCheckLimitForEmptyBlob() {
+    void testCheckLimitForEmptyBlob() {
         List<Tuple2<JobID, BlobKey>> keys = tracker.checkLimit(0L);
 
-        assertEquals(0, keys.size());
+        assertThat(keys).isEmpty();
     }
 
-    @Test(expected = IllegalArgumentException.class)
-    public void testCheckLimitForBlobWithNegativeSize() {
-        tracker.checkLimit(-1L);
+    @Test
+    void testCheckLimitForBlobWithNegativeSize() {
+        assertThatThrownBy(() -> tracker.checkLimit(-1L))
+                .isInstanceOf(IllegalArgumentException.class);
     }
 
     @Test
-    public void testTrack() {
-        assertEquals(3L, (long) tracker.getSize(jobId, blobKey));
-        assertTrue(tracker.getBlobKeysByJobId(jobId).contains(blobKey));
+    void testTrack() {
+        assertThat(tracker.getSize(jobId, blobKey)).isEqualTo(3L);
+        assertThat(tracker.getBlobKeysByJobId(jobId)).contains(blobKey);
     }
 
     /**
@@ -84,40 +81,45 @@ public class BlobCacheSizeTrackerTest extends TestLogger {
      * BlobUtils#moveTempFileToStore} does.
      */
     @Test
-    public void testTrackDuplicatedBlob() {
+    void testTrackDuplicatedBlob() {
         tracker.track(jobId, blobKey, 1L);
-        assertEquals(3L, (long) tracker.getSize(jobId, blobKey));
-        assertEquals(1, tracker.getBlobKeysByJobId(jobId).size());
+        assertThat(tracker.getSize(jobId, blobKey)).isEqualTo(3L);
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(1);
     }
 
     @Test
-    public void testUntrack() {
-        assertEquals(1, tracker.checkLimit(3L).size());
+    void testUntrack() {
+        assertThat(tracker.checkLimit(3L)).hasSize(1);
         tracker.untrack(Tuple2.of(jobId, blobKey));
 
-        assertNull(tracker.getSize(jobId, blobKey));
-        assertEquals(0, tracker.getBlobKeysByJobId(jobId).size());
-        assertEquals(0, tracker.checkLimit(3L).size());
+        assertThat(tracker.getSize(jobId, blobKey)).isNull();
+        assertThat(tracker.getBlobKeysByJobId(jobId)).isEmpty();
+        assertThat(tracker.checkLimit(3L)).isEmpty();
     }
 
     /** Untracking a non-existing BLOB shouldn't change anything or throw any exceptions. */
     @Test
-    public void testUntrackNonExistingBlob() {
+    void testUntrackNonExistingBlob() {
         tracker.untrack(Tuple2.of(jobId, BlobKey.createKey(BlobType.PERMANENT_BLOB)));
-        assertEquals(1, tracker.getBlobKeysByJobId(jobId).size());
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(1);
     }
 
     /**
      * Since the BlobCacheSizeLimitTracker only works in {@link PermanentBlobCache}, the JobID
      * shouldn't be null.
      */
-    @Test(expected = NullPointerException.class)
-    public void testUntrackBlobWithNullJobId() {
-        tracker.untrack(Tuple2.of(null, BlobKey.createKey(BlobType.PERMANENT_BLOB)));
+    @Test
+    void testUntrackBlobWithNullJobId() {
+        assertThatThrownBy(
+                        () ->
+                                tracker.untrack(
+                                        Tuple2.of(
+                                                null, BlobKey.createKey(BlobType.PERMANENT_BLOB))))
+                .isInstanceOf(NullPointerException.class);
     }
 
     @Test
-    public void testUpdate() {
+    void testUpdate() {
         BlobCacheSizeTracker tracker = new BlobCacheSizeTracker(5L);
         List<JobID> jobIds = new ArrayList<>();
         List<BlobKey> blobKeys = new ArrayList<>();
@@ -133,11 +135,10 @@ public class BlobCacheSizeTrackerTest extends TestLogger {
 
         List<Tuple2<JobID, BlobKey>> blobsToDelete = tracker.checkLimit(2);
 
-        assertThat(
-                blobsToDelete,
-                containsInAnyOrder(
+        assertThat(blobsToDelete)
+                .contains(
                         Tuple2.of(jobIds.get(0), blobKeys.get(0)),
-                        Tuple2.of(jobIds.get(3), blobKeys.get(3))));
+                        Tuple2.of(jobIds.get(3), blobKeys.get(3)));
     }
 
     /**
@@ -145,26 +146,26 @@ public class BlobCacheSizeTrackerTest extends TestLogger {
      * exceptions.
      */
     @Test
-    public void testUpdateNonExistingBlob() {
+    void testUpdateNonExistingBlob() {
         tracker.track(new JobID(), BlobKey.createKey(BlobType.PERMANENT_BLOB), 2L);
-        assertEquals(1, tracker.checkLimit(3L).size());
+        assertThat(tracker.checkLimit(3L)).hasSize(1);
 
         tracker.update(new JobID(), BlobKey.createKey(BlobType.PERMANENT_BLOB));
-        assertEquals(1, tracker.checkLimit(3L).size());
+        assertThat(tracker.checkLimit(3L)).hasSize(1);
     }
 
     @Test
-    public void testUntrackAll() {
+    void testUntrackAll() {
         tracker.track(jobId, BlobKey.createKey(BlobType.PERMANENT_BLOB), 1L);
 
         JobID anotherJobId = new JobID();
         tracker.track(anotherJobId, BlobKey.createKey(BlobType.PERMANENT_BLOB), 1L);
 
-        assertEquals(2, tracker.getBlobKeysByJobId(jobId).size());
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(2);
         tracker.untrackAll(jobId);
 
-        assertEquals(0, tracker.getBlobKeysByJobId(jobId).size());
-        assertEquals(1, tracker.getBlobKeysByJobId(anotherJobId).size());
+        assertThat(tracker.getBlobKeysByJobId(jobId)).isEmpty();
+        assertThat(tracker.getBlobKeysByJobId(anotherJobId)).hasSize(1);
     }
 
     /**
@@ -172,12 +173,12 @@ public class BlobCacheSizeTrackerTest extends TestLogger {
      * exceptions.
      */
     @Test
-    public void testUntrackAllWithNonExistingJob() {
+    void testUntrackAllWithNonExistingJob() {
         tracker.track(jobId, BlobKey.createKey(BlobType.PERMANENT_BLOB), 1L);
 
-        assertEquals(2, tracker.getBlobKeysByJobId(jobId).size());
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(2);
         tracker.untrackAll(new JobID());
 
-        assertEquals(2, tracker.getBlobKeysByJobId(jobId).size());
+        assertThat(tracker.getBlobKeysByJobId(jobId)).hasSize(2);
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSuccessTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSuccessTest.java
index c1b2caef85a..984720cc221 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSuccessTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheSuccessTest.java
@@ -19,19 +19,19 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
+import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.IOException;
-import java.net.InetSocketAddress;
+import java.nio.file.Path;
 import java.util.Arrays;
 
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
@@ -40,19 +40,18 @@ import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
 
 /** This class contains unit tests for the {@link BlobCacheService}. */
-public class BlobCacheSuccessTest extends TestLogger {
+class BlobCacheSuccessTest {
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     /**
      * BlobCache with no HA, job-unrelated BLOBs. BLOBs need to be downloaded form a working
      * BlobServer.
      */
     @Test
-    public void testBlobNoJobCache() throws IOException {
+    void testBlobNoJobCache() throws IOException {
         Configuration config = new Configuration();
-        config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+        config.setString(BlobServerOptions.STORAGE_DIRECTORY, tempDir.toString());
 
         uploadFileGetTest(config, null, false, false, TRANSIENT_BLOB);
     }
@@ -62,10 +61,9 @@ public class BlobCacheSuccessTest extends TestLogger {
      * BlobServer.
      */
     @Test
-    public void testBlobForJobCache() throws IOException {
+    void testBlobForJobCache() throws IOException {
         Configuration config = new Configuration();
-        config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+        config.setString(BlobServerOptions.STORAGE_DIRECTORY, tempDir.toString());
 
         uploadFileGetTest(config, new JobID(), false, false, TRANSIENT_BLOB);
     }
@@ -76,13 +74,14 @@ public class BlobCacheSuccessTest extends TestLogger {
      * the BLOB upload. Using job-related BLOBs.
      */
     @Test
-    public void testBlobForJobCacheHa() throws IOException {
+    void testBlobForJobCacheHa() throws IOException {
         Configuration config = new Configuration();
         config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+                BlobServerOptions.STORAGE_DIRECTORY,
+                TempDirUtils.newFolder(tempDir).getAbsolutePath());
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, temporaryFolder.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         uploadFileGetTest(config, new JobID(), true, true, PERMANENT_BLOB);
     }
@@ -93,13 +92,14 @@ public class BlobCacheSuccessTest extends TestLogger {
      * BLOB upload. Using job-related BLOBs.
      */
     @Test
-    public void testBlobForJobCacheHa2() throws IOException {
+    void testBlobForJobCacheHa2() throws IOException {
         Configuration config = new Configuration();
         config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+                BlobServerOptions.STORAGE_DIRECTORY,
+                TempDirUtils.newFolder(tempDir).getAbsolutePath());
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, temporaryFolder.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
         uploadFileGetTest(config, new JobID(), false, true, PERMANENT_BLOB);
     }
 
@@ -108,13 +108,14 @@ public class BlobCacheSuccessTest extends TestLogger {
      * thus needs to download BLOBs from the BlobServer. Using job-related BLOBs.
      */
     @Test
-    public void testBlobForJobCacheHaFallback() throws IOException {
+    void testBlobForJobCacheHaFallback() throws IOException {
         Configuration config = new Configuration();
         config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+                BlobServerOptions.STORAGE_DIRECTORY,
+                TempDirUtils.newFolder(tempDir).getAbsolutePath());
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, temporaryFolder.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         uploadFileGetTest(config, new JobID(), false, false, PERMANENT_BLOB);
     }
@@ -142,12 +143,13 @@ public class BlobCacheSuccessTest extends TestLogger {
 
         final Configuration cacheConfig = new Configuration(config);
         cacheConfig.setString(
-                BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
+                BlobServerOptions.STORAGE_DIRECTORY,
+                TempDirUtils.newFolder(tempDir).getAbsolutePath());
         if (!cacheHasAccessToFs) {
             // make sure the cache cannot access the HA store directly
             cacheConfig.setString(
                     HighAvailabilityOptions.HA_STORAGE_PATH,
-                    temporaryFolder.newFolder().getPath() + "/does-not-exist");
+                    TempDirUtils.newFolder(tempDir).getPath() + "/does-not-exist");
         }
 
         // First create two BLOBs and upload them to BLOB server
@@ -159,15 +161,11 @@ public class BlobCacheSuccessTest extends TestLogger {
 
         try {
             blobStoreService = BlobUtils.createBlobStoreFromConfig(cacheConfig);
-            try (BlobServer server =
-                            new BlobServer(config, temporaryFolder.newFolder(), blobStoreService);
-                    BlobCacheService cache =
-                            new BlobCacheService(
-                                    cacheConfig,
-                                    temporaryFolder.newFolder(),
-                                    blobStoreService,
-                                    new InetSocketAddress("localhost", server.getPort()))) {
-
+            Tuple2<BlobServer, BlobCacheService> serverAndCache =
+                    TestingBlobUtils.createServerAndCache(
+                            tempDir, config, cacheConfig, blobStoreService, blobStoreService);
+            try (BlobServer server = serverAndCache.f0;
+                    BlobCacheService cache = serverAndCache.f1) {
                 server.start();
 
                 // Upload BLOBs
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSslTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSslTest.java
index 51dd5b2a5c9..49d61ed4850 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSslTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSslTest.java
@@ -23,16 +23,16 @@ import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.SecurityOptions;
 import org.apache.flink.runtime.net.SSLUtilsTest;
 
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
 /** This class contains unit tests for the {@link BlobClient} with ssl enabled. */
-public class BlobClientSslTest extends BlobClientTest {
+class BlobClientSslTest extends BlobClientTest {
 
     /** The instance of the SSL BLOB server used during the tests. */
     private static BlobServer blobSslServer;
@@ -46,38 +46,35 @@ public class BlobClientSslTest extends BlobClientTest {
     /** The non-SSL blob service client configuration with SSL-enabled security options. */
     private static Configuration nonSslClientConfig;
 
-    @ClassRule public static TemporaryFolder temporarySslFolder = new TemporaryFolder();
-
     /** Starts the SSL enabled BLOB server. */
-    @BeforeClass
-    public static void startSSLServer() throws IOException {
+    @BeforeAll
+    static void startSSLServer() throws IOException {
         Configuration config =
                 SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                         SecurityOptions.SSL_PROVIDER.defaultValue());
 
-        blobSslServer = new BlobServer(config, temporarySslFolder.newFolder(), new VoidBlobStore());
+        blobSslServer = TestingBlobUtils.createServer(tempDir.resolve("ssl"), config);
         blobSslServer.start();
 
         sslClientConfig = config;
     }
 
-    @BeforeClass
-    public static void startNonSSLServer() throws IOException {
+    @BeforeAll
+    static void startNonSSLServer() throws IOException {
         Configuration config =
                 SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                         SecurityOptions.SSL_PROVIDER.defaultValue());
         config.setBoolean(BlobServerOptions.SSL_ENABLED, false);
 
-        blobNonSslServer =
-                new BlobServer(config, temporarySslFolder.newFolder(), new VoidBlobStore());
+        blobNonSslServer = TestingBlobUtils.createServer(tempDir.resolve("non_ssl"), config);
         blobNonSslServer.start();
 
         nonSslClientConfig = config;
     }
 
     /** Shuts the BLOB server down. */
-    @AfterClass
-    public static void stopServers() throws IOException {
+    @AfterAll
+    static void stopServers() throws IOException {
         if (blobSslServer != null) {
             blobSslServer.close();
         }
@@ -106,31 +103,35 @@ public class BlobClientSslTest extends BlobClientTest {
     }
 
     /** Verify ssl client to non-ssl server failure. */
-    @Test(expected = IOException.class)
-    public void testSSLClientFailure() throws Exception {
+    @Test
+    public void testSSLClientFailure() {
         // SSL client connected to non-ssl server
-        uploadJarFile(blobServer, sslClientConfig);
+        assertThatThrownBy(() -> uploadJarFile(blobServer, sslClientConfig))
+                .isInstanceOf(IOException.class);
     }
 
     /** Verify ssl client to non-ssl server failure. */
-    @Test(expected = IOException.class)
-    public void testSSLClientFailure2() throws Exception {
+    @Test
+    public void testSSLClientFailure2() {
         // SSL client connected to non-ssl server
-        uploadJarFile(blobNonSslServer, sslClientConfig);
+        assertThatThrownBy(() -> uploadJarFile(blobNonSslServer, sslClientConfig))
+                .isInstanceOf(IOException.class);
     }
 
     /** Verify non-ssl client to ssl server failure. */
-    @Test(expected = IOException.class)
-    public void testSSLServerFailure() throws Exception {
+    @Test
+    public void testSSLServerFailure() {
         // Non-SSL client connected to ssl server
-        uploadJarFile(blobSslServer, clientConfig);
+        assertThatThrownBy(() -> uploadJarFile(blobSslServer, clientConfig))
+                .isInstanceOf(IOException.class);
     }
 
     /** Verify non-ssl client to ssl server failure. */
-    @Test(expected = IOException.class)
+    @Test
     public void testSSLServerFailure2() throws Exception {
         // Non-SSL client connected to ssl server
-        uploadJarFile(blobSslServer, nonSslClientConfig);
+        assertThatThrownBy(() -> uploadJarFile(blobSslServer, nonSslClientConfig))
+                .isInstanceOf(IOException.class);
     }
 
     /** Verify non-ssl connection sanity. */
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientTest.java
index c6f983d04fa..943cd766fc0 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientTest.java
@@ -22,24 +22,21 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.Path;
-import org.apache.flink.util.ExceptionUtils;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.EOFException;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.nio.file.Files;
 import java.security.MessageDigest;
 import java.util.Collections;
 import java.util.List;
@@ -49,17 +46,12 @@ import static org.apache.flink.runtime.blob.BlobCachePutTest.verifyDeletedEventu
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeFalse;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /** This class contains unit tests for the {@link BlobClient}. */
-public class BlobClientTest extends TestLogger {
+class BlobClientTest {
 
     /** The buffer size used during the tests in bytes. */
     private static final int TEST_BUFFER_SIZE = 17 * 1000;
@@ -70,21 +62,20 @@ public class BlobClientTest extends TestLogger {
     /** The blob service (non-ssl) client configuration. */
     static Configuration clientConfig;
 
-    @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir static java.nio.file.Path tempDir;
 
     /** Starts the BLOB server. */
-    @BeforeClass
-    public static void startServer() throws IOException {
-        Configuration config = new Configuration();
-        blobServer = new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore());
+    @BeforeAll
+    static void startServer() throws IOException {
+        blobServer = TestingBlobUtils.createServer(tempDir);
         blobServer.start();
 
         clientConfig = new Configuration();
     }
 
     /** Shuts the BLOB server down. */
-    @AfterClass
-    public static void stopServer() throws IOException {
+    @AfterAll
+    static void stopServer() throws IOException {
         if (blobServer != null) {
             blobServer.close();
         }
@@ -167,8 +158,8 @@ public class BlobClientTest extends TestLogger {
                 bytesReceived += read;
 
                 if (bytesReceived == receivedBuffer.length) {
-                    assertEquals(-1, actualInputStream.read());
-                    assertArrayEquals(expectedBuf, receivedBuffer);
+                    assertThat(actualInputStream.read()).isEqualTo(-1);
+                    assertThat(receivedBuffer).isEqualTo(expectedBuf);
                     return;
                 }
             }
@@ -193,7 +184,7 @@ public class BlobClientTest extends TestLogger {
                 final int r1 = actualInputStream.read();
                 final int r2 = expectedInputStream.read();
 
-                assertEquals(r2, r1);
+                assertThat(r1).isEqualTo(r2);
 
                 if (r1 < 0) {
                     break;
@@ -216,7 +207,7 @@ public class BlobClientTest extends TestLogger {
     @SuppressWarnings("WeakerAccess")
     static void validateGetAndClose(final InputStream actualInputStream, final File expectedFile)
             throws IOException {
-        validateGetAndClose(actualInputStream, new FileInputStream(expectedFile));
+        validateGetAndClose(actualInputStream, Files.newInputStream(expectedFile.toPath()));
     }
 
     protected boolean isSSLEnabled() {
@@ -224,13 +215,12 @@ public class BlobClientTest extends TestLogger {
     }
 
     @Test
-    public void testContentAddressableBufferTransientBlob()
-            throws IOException, InterruptedException {
+    void testContentAddressableBufferTransientBlob() throws IOException, InterruptedException {
         testContentAddressableBuffer(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testContentAddressableBufferPermantBlob() throws IOException, InterruptedException {
+    void testContentAddressableBufferPermantBlob() throws IOException, InterruptedException {
         testContentAddressableBuffer(PERMANENT_BLOB);
     }
 
@@ -259,13 +249,13 @@ public class BlobClientTest extends TestLogger {
             BlobKey receivedKey1 = null;
             if (blobType == TRANSIENT_BLOB) {
                 receivedKey1 = client.putBuffer(null, testBuffer, 0, testBuffer.length, blobType);
-                assertArrayEquals(digest, receivedKey1.getHash());
+                assertThat(receivedKey1.getHash()).isEqualTo(digest);
             }
 
             // try again with a job-related BLOB:
             BlobKey receivedKey2 =
                     client.putBuffer(jobId, testBuffer, 0, testBuffer.length, blobType);
-            assertArrayEquals(digest, receivedKey2.getHash());
+            assertThat(receivedKey2.getHash()).isEqualTo(digest);
             if (blobType == TRANSIENT_BLOB) {
                 verifyKeyDifferentHashEquals(receivedKey1, receivedKey2);
             }
@@ -284,20 +274,16 @@ public class BlobClientTest extends TestLogger {
             }
 
             // Check reaction to invalid keys for job-unrelated blobs
-            try (InputStream ignored = client.getInternal(null, BlobKey.createKey(blobType))) {
-                fail("Expected IOException did not occur");
-            } catch (IOException fnfe) {
-                // expected
-            }
+            final BlobClient finalClient1 = client;
+            assertThatThrownBy(() -> finalClient1.getInternal(null, BlobKey.createKey(blobType)))
+                    .isInstanceOf(IOException.class);
 
             // Check reaction to invalid keys for job-related blobs
             // new client needed (closed from failure above)
             client = new BlobClient(serverAddress, getBlobClientConfig());
-            try (InputStream ignored = client.getInternal(jobId, BlobKey.createKey(blobType))) {
-                fail("Expected IOException did not occur");
-            } catch (IOException fnfe) {
-                // expected
-            }
+            final BlobClient finalClient2 = client;
+            assertThatThrownBy(() -> finalClient2.getInternal(jobId, BlobKey.createKey(blobType)))
+                    .isInstanceOf(IOException.class);
         } finally {
             if (client != null) {
                 try {
@@ -317,14 +303,12 @@ public class BlobClientTest extends TestLogger {
     }
 
     @Test
-    public void testContentAddressableStreamTransientBlob()
-            throws IOException, InterruptedException {
+    void testContentAddressableStreamTransientBlob() throws IOException, InterruptedException {
         testContentAddressableStream(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testContentAddressableStreamPermanentBlob()
-            throws IOException, InterruptedException {
+    void testContentAddressableStreamPermanentBlob() throws IOException, InterruptedException {
         testContentAddressableStream(PERMANENT_BLOB);
     }
 
@@ -336,7 +320,7 @@ public class BlobClientTest extends TestLogger {
     private void testContentAddressableStream(BlobKey.BlobType blobType)
             throws IOException, InterruptedException {
 
-        File testFile = temporaryFolder.newFile();
+        File testFile = tempDir.resolve("test_file").toFile();
         byte[] digest = prepareTestFile(testFile);
 
         InputStream is = null;
@@ -351,13 +335,13 @@ public class BlobClientTest extends TestLogger {
 
             // Store the data (job-unrelated)
             if (blobType == TRANSIENT_BLOB) {
-                is = new FileInputStream(testFile);
+                is = Files.newInputStream(testFile.toPath());
                 receivedKey1 = client.putInputStream(null, is, blobType);
-                assertArrayEquals(digest, receivedKey1.getHash());
+                assertThat(receivedKey1.getHash()).isEqualTo(digest);
             }
 
             // try again with a job-related BLOB:
-            is = new FileInputStream(testFile);
+            is = Files.newInputStream(testFile.toPath());
             BlobKey receivedKey2 = client.putInputStream(jobId, is, blobType);
 
             is.close();
@@ -388,17 +372,17 @@ public class BlobClientTest extends TestLogger {
     }
 
     @Test
-    public void testGetFailsDuringStreamingNoJobTransientBlob() throws IOException {
+    void testGetFailsDuringStreamingNoJobTransientBlob() throws IOException {
         testGetFailsDuringStreaming(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetFailsDuringStreamingForJobTransientBlob() throws IOException {
+    void testGetFailsDuringStreamingForJobTransientBlob() throws IOException {
         testGetFailsDuringStreaming(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetFailsDuringStreamingForJobPermanentBlob() throws IOException {
+    void testGetFailsDuringStreamingForJobPermanentBlob() throws IOException {
         testGetFailsDuringStreaming(new JobID(), PERMANENT_BLOB);
     }
 
@@ -411,7 +395,9 @@ public class BlobClientTest extends TestLogger {
     private void testGetFailsDuringStreaming(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
 
-        assumeFalse("This test can deadlock when using SSL. See FLINK-19369.", isSSLEnabled());
+        assumeThat(isSSLEnabled())
+                .as("This test can deadlock when using SSL. See FLINK-19369.")
+                .isFalse();
 
         try (BlobClient client =
                 new BlobClient(
@@ -424,7 +410,7 @@ public class BlobClientTest extends TestLogger {
 
             // put content addressable (like libraries)
             BlobKey key = client.putBuffer(jobId, data, 0, data.length, blobType);
-            assertNotNull(key);
+            assertThat(key).isNotNull();
 
             // issue a GET request that succeeds
             InputStream is = client.getInternal(jobId, key);
@@ -448,7 +434,7 @@ public class BlobClientTest extends TestLogger {
                         null);
                 // we tolerate that this succeeds, as the receiver socket may have buffered
                 // everything already, but in this case, also verify the contents
-                assertArrayEquals(data, receiveBuffer);
+                assertThat(receiveBuffer).isEqualTo(data);
             } catch (IOException e) {
                 // expected
             }
@@ -460,7 +446,7 @@ public class BlobClientTest extends TestLogger {
      * List)} helper.
      */
     @Test
-    public void testUploadJarFilesHelper() throws Exception {
+    void testUploadJarFilesHelper() throws Exception {
         uploadJarFile(getBlobServer(), getBlobClientConfig());
     }
 
@@ -493,7 +479,7 @@ public class BlobClientTest extends TestLogger {
                         jobId,
                         Collections.singletonList(new Path(testFile.toURI())));
 
-        assertEquals(1, blobKeys.size());
+        assertThat(blobKeys).hasSize(1);
 
         try (BlobClient blobClient = new BlobClient(serverAddress, blobClientConfig)) {
             validateGetAndClose(blobClient.getInternal(jobId, blobKeys.get(0)), testFile);
@@ -502,7 +488,7 @@ public class BlobClientTest extends TestLogger {
 
     /** Tests the socket operation timeout. */
     @Test
-    public void testSocketTimeout() throws IOException {
+    void testSocketTimeout() throws IOException {
         Configuration clientConfig = getBlobClientConfig();
         int oldSoTimeout = clientConfig.getInteger(BlobServerOptions.SO_TIMEOUT);
 
@@ -510,20 +496,20 @@ public class BlobClientTest extends TestLogger {
 
         try (final TestBlobServer testBlobServer =
                 new TestBlobServer(
-                        clientConfig, temporaryFolder.newFolder(), new VoidBlobStore(), 10_000L)) {
+                        clientConfig,
+                        tempDir.resolve("test_server").toFile(),
+                        new VoidBlobStore(),
+                        10_000L)) {
             testBlobServer.start();
             InetSocketAddress serverAddress =
                     new InetSocketAddress("localhost", testBlobServer.getPort());
 
             try (BlobClient client = new BlobClient(serverAddress, clientConfig)) {
-                client.getInternal(new JobID(), BlobKey.createKey(TRANSIENT_BLOB));
-
-                fail("Should throw an exception.");
-            } catch (Throwable t) {
-                assertThat(
-                        ExceptionUtils.findThrowable(t, java.net.SocketTimeoutException.class)
-                                .isPresent(),
-                        is(true));
+                assertThatThrownBy(
+                                () ->
+                                        client.getInternal(
+                                                new JobID(), BlobKey.createKey(TRANSIENT_BLOB)))
+                        .hasCauseInstanceOf(java.net.SocketTimeoutException.class);
             }
         } finally {
             clientConfig.setInteger(BlobServerOptions.SO_TIMEOUT, oldSoTimeout);
@@ -531,12 +517,12 @@ public class BlobClientTest extends TestLogger {
     }
 
     @Test
-    public void testUnresolvedInetSocketAddress() throws Exception {
+    void testUnresolvedInetSocketAddress() throws Exception {
         try (BlobClient client =
                 new BlobClient(
                         InetSocketAddress.createUnresolved("localhost", getBlobServer().getPort()),
                         getBlobClientConfig())) {
-            assertTrue(client.isConnected());
+            assertThat(client.isConnected()).isTrue();
         }
     }
 
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java
index cd7b25951d3..cf8fc0e2bef 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java
@@ -21,9 +21,8 @@ package org.apache.flink.runtime.blob;
 import org.apache.flink.core.testutils.CommonTestUtils;
 import org.apache.flink.util.AbstractID;
 import org.apache.flink.util.StringUtils;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -31,21 +30,11 @@ import java.io.IOException;
 
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.lessThan;
-import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** This class contains unit tests for the {@link BlobKey} class. */
-public final class BlobKeyTest extends TestLogger {
+final class BlobKeyTest {
     /** The first key array to be used during the unit tests. */
     private static final byte[] KEY_ARRAY_1 = new byte[BlobKey.SIZE];
 
@@ -73,23 +62,23 @@ public final class BlobKeyTest extends TestLogger {
     }
 
     @Test
-    public void testCreateKey() {
+    void testCreateKey() {
         BlobKey key = BlobKey.createKey(PERMANENT_BLOB, KEY_ARRAY_1);
         verifyType(PERMANENT_BLOB, key);
-        assertArrayEquals(KEY_ARRAY_1, key.getHash());
+        assertThat(key.getHash()).isEqualTo(KEY_ARRAY_1);
 
         key = BlobKey.createKey(TRANSIENT_BLOB, KEY_ARRAY_1);
         verifyType(TRANSIENT_BLOB, key);
-        assertArrayEquals(KEY_ARRAY_1, key.getHash());
+        assertThat(key.getHash()).isEqualTo(KEY_ARRAY_1);
     }
 
     @Test
-    public void testSerializationTransient() throws Exception {
+    void testSerializationTransient() throws Exception {
         testSerialization(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testSerializationPermanent() throws Exception {
+    void testSerializationPermanent() throws Exception {
         testSerialization(PERMANENT_BLOB);
     }
 
@@ -97,18 +86,18 @@ public final class BlobKeyTest extends TestLogger {
     private void testSerialization(BlobKey.BlobType blobType) throws Exception {
         final BlobKey k1 = BlobKey.createKey(blobType, KEY_ARRAY_1, RANDOM_ARRAY_1);
         final BlobKey k2 = CommonTestUtils.createCopySerializable(k1);
-        assertEquals(k1, k2);
-        assertEquals(k1.hashCode(), k2.hashCode());
-        assertEquals(0, k1.compareTo(k2));
+        assertThat(k2).isEqualTo(k1);
+        assertThat(k2).hasSameHashCodeAs(k1);
+        assertThat(k1).isEqualByComparingTo(k2);
     }
 
     @Test
-    public void testEqualsTransient() {
+    void testEqualsTransient() {
         testEquals(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testEqualsPermanent() {
+    void testEqualsPermanent() {
         testEquals(PERMANENT_BLOB);
     }
 
@@ -118,36 +107,35 @@ public final class BlobKeyTest extends TestLogger {
         final BlobKey k2 = BlobKey.createKey(blobType, KEY_ARRAY_1, RANDOM_ARRAY_1);
         final BlobKey k3 = BlobKey.createKey(blobType, KEY_ARRAY_2, RANDOM_ARRAY_1);
         final BlobKey k4 = BlobKey.createKey(blobType, KEY_ARRAY_1, RANDOM_ARRAY_2);
-        assertTrue(k1.equals(k2));
-        assertTrue(k2.equals(k1));
-        assertEquals(k1.hashCode(), k2.hashCode());
-        assertFalse(k1.equals(k3));
-        assertFalse(k3.equals(k1));
-        assertFalse(k1.equals(k4));
-        assertFalse(k4.equals(k1));
-
-        //noinspection ObjectEqualsNull
-        assertFalse(k1.equals(null));
-        //noinspection EqualsBetweenInconvertibleTypes
-        assertFalse(k1.equals(this));
+        assertThat(k1).isEqualTo(k2);
+        assertThat(k2).isEqualTo(k1);
+        assertThat(k2).hasSameHashCodeAs(k1);
+        assertThat(k1).isNotEqualTo(k3);
+        assertThat(k3).isNotEqualTo(k1);
+        assertThat(k1).isNotEqualTo(k4);
+        assertThat(k4).isNotEqualTo(k1);
+
+        assertThat(k1).isNotEqualTo(null);
+        //noinspection AssertBetweenInconvertibleTypes
+        assertThat(k1).isNotEqualTo(this);
     }
 
     /** Tests the equals method. */
     @Test
-    public void testEqualsDifferentBlobType() {
+    void testEqualsDifferentBlobType() {
         final BlobKey k1 = BlobKey.createKey(TRANSIENT_BLOB, KEY_ARRAY_1, RANDOM_ARRAY_1);
         final BlobKey k2 = BlobKey.createKey(PERMANENT_BLOB, KEY_ARRAY_1, RANDOM_ARRAY_1);
-        assertFalse(k1.equals(k2));
-        assertFalse(k2.equals(k1));
+        assertThat(k1).isNotEqualTo(k2);
+        assertThat(k2).isNotEqualTo(k1);
     }
 
     @Test
-    public void testComparesTransient() {
+    void testComparesTransient() {
         testCompares(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testComparesPermanent() {
+    void testComparesPermanent() {
         testCompares(PERMANENT_BLOB);
     }
 
@@ -157,39 +145,39 @@ public final class BlobKeyTest extends TestLogger {
         final BlobKey k2 = BlobKey.createKey(blobType, KEY_ARRAY_1, RANDOM_ARRAY_1);
         final BlobKey k3 = BlobKey.createKey(blobType, KEY_ARRAY_2, RANDOM_ARRAY_1);
         final BlobKey k4 = BlobKey.createKey(blobType, KEY_ARRAY_1, RANDOM_ARRAY_2);
-        assertThat(k1.compareTo(k2), is(0));
-        assertThat(k2.compareTo(k1), is(0));
-        assertThat(k1.compareTo(k3), lessThan(0));
-        assertThat(k1.compareTo(k4), lessThan(0));
-        assertThat(k3.compareTo(k1), greaterThan(0));
-        assertThat(k4.compareTo(k1), greaterThan(0));
+        assertThat(k1).isEqualByComparingTo(k2);
+        assertThat(k2).isEqualByComparingTo(k1);
+        assertThat(k1).isLessThan(k3);
+        assertThat(k1).isLessThan(k4);
+        assertThat(k3).isGreaterThan(k1);
+        assertThat(k4).isGreaterThan(k1);
     }
 
     @Test
-    public void testComparesDifferentBlobType() {
+    void testComparesDifferentBlobType() {
         final BlobKey k1 = BlobKey.createKey(TRANSIENT_BLOB, KEY_ARRAY_1, RANDOM_ARRAY_1);
         final BlobKey k2 = BlobKey.createKey(PERMANENT_BLOB, KEY_ARRAY_1, RANDOM_ARRAY_1);
-        assertThat(k1.compareTo(k2), greaterThan(0));
-        assertThat(k2.compareTo(k1), lessThan(0));
+        assertThat(k1).isGreaterThan(k2);
+        assertThat(k2).isLessThan(k1);
     }
 
     @Test
-    public void testStreamsTransient() throws Exception {
+    void testStreamsTransient() throws Exception {
         testStreams(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testStreamsPermanent() throws Exception {
+    void testStreamsPermanent() throws Exception {
         testStreams(PERMANENT_BLOB);
     }
 
     @Test
-    public void testToFromStringPermanentKey() {
+    void testToFromStringPermanentKey() {
         testToFromString(BlobKey.createKey(PERMANENT_BLOB));
     }
 
     @Test
-    public void testToFromStringTransientKey() {
+    void testToFromStringTransientKey() {
         testToFromString(BlobKey.createKey(TRANSIENT_BLOB));
     }
 
@@ -197,21 +185,25 @@ public final class BlobKeyTest extends TestLogger {
         final String stringRepresentation = blobKey.toString();
         final BlobKey parsedBlobKey = BlobKey.fromString(stringRepresentation);
 
-        assertThat(blobKey, equalTo(parsedBlobKey));
+        assertThat(blobKey).isEqualTo(parsedBlobKey);
     }
 
-    @Test(expected = IllegalStateException.class)
-    public void testFromStringFailsWithWrongInput() {
-        BlobKey.fromString("foobar");
+    @Test
+    void testFromStringFailsWithWrongInput() {
+        assertThatThrownBy(() -> BlobKey.fromString("foobar"))
+                .isInstanceOf(IllegalStateException.class);
     }
 
-    @Test(expected = IllegalStateException.class)
-    public void testFromStringFailsWithInvalidBlobKeyType() {
-        BlobKey.fromString(
-                String.format(
-                        "x-%s-%s",
-                        StringUtils.byteToHexString(KEY_ARRAY_1),
-                        StringUtils.byteToHexString(RANDOM_ARRAY_1)));
+    @Test
+    void testFromStringFailsWithInvalidBlobKeyType() {
+        assertThatThrownBy(
+                        () ->
+                                BlobKey.fromString(
+                                        String.format(
+                                                "x-%s-%s",
+                                                StringUtils.byteToHexString(KEY_ARRAY_1),
+                                                StringUtils.byteToHexString(RANDOM_ARRAY_1))))
+                .isInstanceOf(IllegalStateException.class);
     }
 
     /** Test the serialization/deserialization using input/output streams. */
@@ -225,7 +217,7 @@ public final class BlobKeyTest extends TestLogger {
         final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final BlobKey k2 = BlobKey.readFromInputStream(bais);
 
-        assertEquals(k1, k2);
+        assertThat(k2).isEqualTo(k1);
     }
 
     /**
@@ -235,8 +227,8 @@ public final class BlobKeyTest extends TestLogger {
      * @param key2 second blob key
      */
     static void verifyKeyDifferentHashEquals(BlobKey key1, BlobKey key2) {
-        assertNotEquals(key1, key2);
-        assertThat(key1.getHash(), equalTo(key2.getHash()));
+        assertThat(key1).isNotEqualTo(key2);
+        assertThat(key1.getHash()).isEqualTo(key2.getHash());
     }
 
     /**
@@ -246,8 +238,8 @@ public final class BlobKeyTest extends TestLogger {
      * @param key2 second blob key
      */
     static void verifyKeyDifferentHashDifferent(BlobKey key1, BlobKey key2) {
-        assertNotEquals(key1, key2);
-        assertThat(key1.getHash(), not(equalTo(key2.getHash())));
+        assertThat(key1).isNotEqualTo(key2);
+        assertThat(key1.getHash()).isNotEqualTo(key2.getHash());
     }
 
     /**
@@ -258,9 +250,9 @@ public final class BlobKeyTest extends TestLogger {
      */
     static void verifyType(BlobKey.BlobType expected, BlobKey key) {
         if (expected == PERMANENT_BLOB) {
-            assertThat(key, is(instanceOf(PermanentBlobKey.class)));
+            assertThat(key).isInstanceOf(PermanentBlobKey.class);
         } else {
-            assertThat(key, is(instanceOf(TransientBlobKey.class)));
+            assertThat(key).isInstanceOf(TransientBlobKey.class);
         }
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
index b1aa90c9069..0bc1258e75f 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
@@ -24,7 +24,6 @@ import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.testutils.CommonTestUtils;
 import org.apache.flink.util.FlinkException;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 import org.apache.flink.util.function.TriConsumerWithException;
 
@@ -58,12 +57,14 @@ import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFileCountForJob;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFilesExist;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
 
 /** A few tests for the cleanup of transient BLOBs at the {@link BlobServer}. */
-public class BlobServerCleanupTest extends TestLogger {
+class BlobServerCleanupTest {
 
     private static final Random RANDOM = new Random();
 
@@ -92,13 +93,13 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testTransientBlobNoJobCleanup()
+    void testTransientBlobNoJobCleanup()
             throws IOException, InterruptedException, ExecutionException {
         testTransientBlobCleanup(null);
     }
 
     @Test
-    public void testTransientBlobForJobCleanup()
+    void testTransientBlobForJobCleanup()
             throws IOException, InterruptedException, ExecutionException {
         testTransientBlobCleanup(new JobID());
     }
@@ -210,7 +211,7 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testLocalCleanup() throws Exception {
+    void testLocalCleanup() throws Exception {
         final TestingBlobStore blobStore =
                 createTestingBlobStoreBuilder()
                         .setDeleteAllFunction(
@@ -227,7 +228,7 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testGlobalCleanup() throws Exception {
+    void testGlobalCleanup() throws Exception {
         final Set<JobID> actuallyDeletedJobData = new HashSet<>();
         final JobID jobId = new JobID();
         final TestingBlobStore blobStore =
@@ -248,7 +249,7 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testGlobalCleanupUnsuccessfulInBlobStore() throws Exception {
+    void testGlobalCleanupUnsuccessfulInBlobStore() throws Exception {
         final TestingBlobStore blobStore =
                 createTestingBlobStoreBuilder()
                         .setDeleteAllFunction(jobDataToDelete -> false)
@@ -268,7 +269,7 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testGlobalCleanupFailureInBlobStore() throws Exception {
+    void testGlobalCleanupFailureInBlobStore() throws Exception {
         final RuntimeException actualException = new RuntimeException("Expected RuntimeException");
         final TestingBlobStore blobStore =
                 createTestingBlobStoreBuilder()
@@ -364,12 +365,12 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testBlobServerExpiresRecoveredTransientJobBlob() throws Exception {
+    void testBlobServerExpiresRecoveredTransientJobBlob() throws Exception {
         runBlobServerExpiresRecoveredTransientBlob(new JobID());
     }
 
     @Test
-    public void testBlobServerExpiresRecoveredTransientNoJobBlob() throws Exception {
+    void testBlobServerExpiresRecoveredTransientNoJobBlob() throws Exception {
         runBlobServerExpiresRecoveredTransientBlob(null);
     }
 
@@ -389,7 +390,7 @@ public class BlobServerCleanupTest extends TestLogger {
     }
 
     @Test
-    public void testBlobServerRetainsJobs() throws Exception {
+    void testBlobServerRetainsJobs() throws Exception {
         final JobID jobId1 = new JobID();
         final JobID jobId2 = new JobID();
 
@@ -413,82 +414,4 @@ public class BlobServerCleanupTest extends TestLogger {
             assertThat(executorService.shutdownNow()).isEmpty();
         }
     }
-
-    /**
-     * Checks how many of the files given by blob keys are accessible.
-     *
-     * @param jobId ID of a job
-     * @param keys blob keys to check
-     * @param blobService BLOB store to use
-     * @param doThrow whether exceptions should be ignored (<tt>false</tt>), or thrown
-     *     (<tt>true</tt>)
-     * @return number of files existing at {@link BlobServer#getStorageLocation(JobID, BlobKey)} and
-     *     {@link PermanentBlobCache#getStorageLocation(JobID, BlobKey)}, respectively
-     */
-    public static <T> int checkFilesExist(
-            JobID jobId, Collection<? extends BlobKey> keys, T blobService, boolean doThrow)
-            throws IOException {
-
-        int numFiles = 0;
-
-        for (BlobKey key : keys) {
-            final File storageDir;
-            if (blobService instanceof BlobServer) {
-                BlobServer server = (BlobServer) blobService;
-                storageDir = server.getStorageDir();
-            } else if (blobService instanceof PermanentBlobCache) {
-                PermanentBlobCache cache = (PermanentBlobCache) blobService;
-                storageDir = cache.getStorageDir();
-            } else if (blobService instanceof TransientBlobCache) {
-                TransientBlobCache cache = (TransientBlobCache) blobService;
-                storageDir = cache.getStorageDir();
-            } else {
-                throw new UnsupportedOperationException(
-                        "unsupported BLOB service class: "
-                                + blobService.getClass().getCanonicalName());
-            }
-
-            final File blobFile =
-                    new File(
-                            BlobUtils.getStorageLocationPath(
-                                    storageDir.getAbsolutePath(), jobId, key));
-            if (blobFile.exists()) {
-                ++numFiles;
-            } else if (doThrow) {
-                throw new IOException("File " + blobFile + " does not exist.");
-            }
-        }
-
-        return numFiles;
-    }
-
-    /**
-     * Checks how many of the files given by blob keys are accessible.
-     *
-     * @param expectedCount number of expected files in the blob service for the given job
-     * @param jobId ID of a job
-     * @param blobService BLOB store to use
-     */
-    public static void checkFileCountForJob(
-            int expectedCount, JobID jobId, PermanentBlobService blobService) throws IOException {
-
-        final File jobDir;
-        if (blobService instanceof BlobServer) {
-            BlobServer server = (BlobServer) blobService;
-            jobDir = server.getStorageLocation(jobId, new PermanentBlobKey()).getParentFile();
-        } else {
-            PermanentBlobCache cache = (PermanentBlobCache) blobService;
-            jobDir = cache.getStorageLocation(jobId, new PermanentBlobKey()).getParentFile();
-        }
-        File[] blobsForJob = jobDir.listFiles();
-        if (blobsForJob == null) {
-            if (expectedCount != 0) {
-                throw new IOException("File " + jobDir + " does not exist.");
-            }
-        } else {
-            assertThat(blobsForJob.length)
-                    .as("Too many/few files in job dir: " + Arrays.asList(blobsForJob))
-                    .isEqualTo(expectedCount);
-        }
-    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCorruptionTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCorruptionTest.java
index 150dde7399c..424a8b02725 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCorruptionTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCorruptionTest.java
@@ -18,113 +18,52 @@
 
 package org.apache.flink.runtime.blob;
 
-import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.core.testutils.FlinkAssertions;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.apache.commons.io.FileUtils;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
-import java.io.File;
 import java.io.IOException;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.Random;
-
-import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import java.nio.file.Path;
 
 /**
  * Tests how GET requests react to corrupt files when downloaded via a {@link BlobServer}.
  *
  * <p>Successful GET requests are tested in conjunction wit the PUT requests.
  */
-public class BlobServerCorruptionTest extends TestLogger {
+class BlobServerCorruptionTest {
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     /**
      * Checks the GET operation fails when the downloaded file (from {@link BlobServer} or HA store)
      * is corrupt, i.e. its content's hash does not match the {@link BlobKey}'s hash.
      */
     @Test
-    public void testGetFailsFromCorruptFile() throws IOException {
+    void testGetFailsFromCorruptFile() throws IOException {
 
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
                 BlobServerOptions.STORAGE_DIRECTORY,
-                TEMPORARY_FOLDER.newFolder().getAbsolutePath());
+                TempDirUtils.newFolder(tempDir).getAbsolutePath());
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStoreService = null;
 
         try {
             blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
-            testGetFailsFromCorruptFile(config, blobStoreService, TEMPORARY_FOLDER.newFolder());
+            TestingBlobHelpers.testGetFailsFromCorruptFile(
+                    config, blobStoreService, TempDirUtils.newFolder(tempDir));
         } finally {
             if (blobStoreService != null) {
                 blobStoreService.closeAndCleanupAllData();
             }
         }
     }
-
-    /**
-     * Checks the GET operation fails when the downloaded file (from HA store) is corrupt, i.e. its
-     * content's hash does not match the {@link BlobKey}'s hash.
-     *
-     * @param config blob server configuration (including HA settings like {@link
-     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
-     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
-     * @param blobStore shared HA blob store to use
-     */
-    public static void testGetFailsFromCorruptFile(
-            Configuration config, BlobStore blobStore, File blobStorage) throws IOException {
-
-        Random rnd = new Random();
-        JobID jobId = new JobID();
-
-        try (BlobServer server = new BlobServer(config, blobStorage, blobStore)) {
-
-            server.start();
-
-            byte[] data = new byte[2000000];
-            rnd.nextBytes(data);
-
-            // put content addressable (like libraries)
-            BlobKey key = put(server, jobId, data, PERMANENT_BLOB);
-            assertNotNull(key);
-
-            // delete local file to make sure that the GET requests downloads from HA
-            File blobFile = server.getStorageLocation(jobId, key);
-            assertTrue(blobFile.delete());
-
-            // change HA store file contents to make sure that GET requests fail
-            byte[] data2 = Arrays.copyOf(data, data.length);
-            data2[0] ^= 1;
-            File tmpFile = Files.createTempFile("blob", ".jar").toFile();
-            try {
-                FileUtils.writeByteArrayToFile(tmpFile, data2);
-                blobStore.put(tmpFile, jobId, key);
-            } finally {
-                //noinspection ResultOfMethodCallIgnored
-                tmpFile.delete();
-            }
-
-            assertThatThrownBy(() -> get(server, jobId, key))
-                    .satisfies(
-                            FlinkAssertions.anyCauseMatches(IOException.class, "data corruption"));
-        }
-    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
index 91ad3ff2338..5d604183fa7 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
@@ -19,22 +19,19 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
-import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Preconditions;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
-import org.hamcrest.collection.IsEmptyCollection;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -49,52 +46,48 @@ import java.util.concurrent.Executors;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFileCountForJob;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFileCountForJob;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /** Tests how DELETE requests behave. */
-public class BlobServerDeleteTest extends TestLogger {
+class BlobServerDeleteTest {
 
     private final Random rnd = new Random();
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     @Test
-    public void testDeleteTransient1() throws IOException {
+    void testDeleteTransient1() throws IOException {
         testDeleteBlob(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransient2() throws IOException {
+    void testDeleteTransient2() throws IOException {
         testDeleteBlob(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransient3() throws IOException {
+    void testDeleteTransient3() throws IOException {
         testDeleteBlob(null, null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransient4() throws IOException {
+    void testDeleteTransient4() throws IOException {
         testDeleteBlob(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransient5() throws IOException {
+    void testDeleteTransient5() throws IOException {
         JobID jobId = new JobID();
         testDeleteBlob(jobId, jobId, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeletePermanent() throws IOException {
+    void testDeletePermanent() throws IOException {
         testDeleteBlob(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -109,11 +102,7 @@ public class BlobServerDeleteTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2, BlobKey.BlobType blobType)
             throws IOException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -123,17 +112,17 @@ public class BlobServerDeleteTest extends TestLogger {
 
             // put first BLOB
             BlobKey key1 = put(server, jobId1, data, blobType);
-            assertNotNull(key1);
+            assertThat(key1).isNotNull();
 
             // put two more BLOBs (same key, other key) for another job ID
             BlobKey key2a = put(server, jobId2, data, blobType);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1, key2a);
             BlobKey key2b = put(server, jobId2, data2, blobType);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
 
             // issue a DELETE request
-            assertTrue(delete(server, jobId1, key1, blobType));
+            assertThat(delete(server, jobId1, key1, blobType)).isTrue();
 
             verifyDeleted(server, jobId1, key1);
             // deleting a one BLOB should not affect another BLOB with a different key
@@ -142,28 +131,28 @@ public class BlobServerDeleteTest extends TestLogger {
             verifyContents(server, jobId2, key2b, data2);
 
             // delete first file of second job
-            assertTrue(delete(server, jobId2, key2a, blobType));
+            assertThat(delete(server, jobId2, key2a, blobType)).isTrue();
             verifyDeleted(server, jobId2, key2a);
             verifyContents(server, jobId2, key2b, data2);
 
             // delete second file of second job
-            assertTrue(delete(server, jobId2, key2b, blobType));
+            assertThat(delete(server, jobId2, key2b, blobType)).isTrue();
             verifyDeleted(server, jobId2, key2b);
         }
     }
 
     @Test
-    public void testDeleteTransientAlreadyDeletedNoJob() throws IOException {
+    void testDeleteTransientAlreadyDeletedNoJob() throws IOException {
         testDeleteBlobAlreadyDeleted(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransientAlreadyDeletedForJob() throws IOException {
+    void testDeleteTransientAlreadyDeletedForJob() throws IOException {
         testDeleteBlobAlreadyDeleted(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeletePermanentAlreadyDeletedForJob() throws IOException {
+    void testDeletePermanentAlreadyDeletedForJob() throws IOException {
         testDeleteBlobAlreadyDeleted(new JobID(), PERMANENT_BLOB);
     }
 
@@ -176,11 +165,7 @@ public class BlobServerDeleteTest extends TestLogger {
     private void testDeleteBlobAlreadyDeleted(
             @Nullable final JobID jobId, BlobKey.BlobType blobType) throws IOException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -188,33 +173,33 @@ public class BlobServerDeleteTest extends TestLogger {
 
             // put BLOB
             BlobKey key = put(server, jobId, data, blobType);
-            assertNotNull(key);
+            assertThat(key).isNotNull();
 
             File blobFile = server.getStorageLocation(jobId, key);
-            assertTrue(blobFile.delete());
+            assertThat(blobFile.delete()).isTrue();
 
             // DELETE operation should not fail if file is already deleted
-            assertTrue(delete(server, jobId, key, blobType));
+            assertThat(delete(server, jobId, key, blobType)).isTrue();
             verifyDeleted(server, jobId, key);
 
             // one more delete call that should not fail
-            assertTrue(delete(server, jobId, key, blobType));
+            assertThat(delete(server, jobId, key, blobType)).isTrue();
             verifyDeleted(server, jobId, key);
         }
     }
 
     @Test
-    public void testDeleteTransientFailsNoJob() throws IOException {
+    void testDeleteTransientFailsNoJob() throws IOException {
         testDeleteBlobFails(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeleteTransientFailsForJob() throws IOException {
+    void testDeleteTransientFailsForJob() throws IOException {
         testDeleteBlobFails(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testDeletePermanentFailsForJob() throws IOException {
+    void testDeletePermanentFailsForJob() throws IOException {
         testDeleteBlobFails(new JobID(), PERMANENT_BLOB);
     }
 
@@ -227,15 +212,11 @@ public class BlobServerDeleteTest extends TestLogger {
      */
     private void testDeleteBlobFails(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
-        final Configuration config = new Configuration();
         File blobFile = null;
         File directory = null;
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             try {
@@ -244,16 +225,16 @@ public class BlobServerDeleteTest extends TestLogger {
 
                 // put BLOB
                 BlobKey key = put(server, jobId, data, blobType);
-                assertNotNull(key);
+                assertThat(key).isNotNull();
 
                 blobFile = server.getStorageLocation(jobId, key);
                 directory = blobFile.getParentFile();
 
-                assertTrue(blobFile.setWritable(false, false));
-                assertTrue(directory.setWritable(false, false));
+                assertThat(blobFile.setWritable(false, false)).isTrue();
+                assertThat(directory.setWritable(false, false)).isTrue();
 
                 // issue a DELETE request
-                assertFalse(delete(server, jobId, key, blobType));
+                assertThat(delete(server, jobId, key, blobType)).isFalse();
 
                 // the file should still be there
                 verifyContents(server, jobId, key, data);
@@ -269,12 +250,12 @@ public class BlobServerDeleteTest extends TestLogger {
     }
 
     @Test
-    public void testJobCleanup() throws IOException {
+    void testJobCleanup() throws IOException {
         testJobCleanup(TRANSIENT_BLOB);
     }
 
     @Test
-    public void testJobCleanupHa() throws IOException {
+    void testJobCleanupHa() throws IOException {
         testJobCleanup(PERMANENT_BLOB);
     }
 
@@ -288,12 +269,8 @@ public class BlobServerDeleteTest extends TestLogger {
         JobID jobId1 = new JobID();
         JobID jobId2 = new JobID();
 
-        Configuration config = new Configuration();
-
         final ExecutorService executorService = Executors.newSingleThreadExecutor();
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             final byte[] data = new byte[128];
@@ -302,7 +279,7 @@ public class BlobServerDeleteTest extends TestLogger {
 
             BlobKey key1a = put(server, jobId1, data, blobType);
             BlobKey key2 = put(server, jobId2, data, blobType);
-            assertArrayEquals(key1a.getHash(), key2.getHash());
+            assertThat(key1a.getHash()).isEqualTo(key2.getHash());
 
             BlobKey key1b = put(server, jobId1, data2, blobType);
 
@@ -330,18 +307,18 @@ public class BlobServerDeleteTest extends TestLogger {
             // calling a second time should not fail
             server.globalCleanupAsync(jobId2, executorService).join();
         } finally {
-            assertThat(executorService.shutdownNow(), IsEmptyCollection.empty());
+            assertThat(executorService.shutdownNow()).isEmpty();
         }
     }
 
     @Test
-    public void testConcurrentDeleteOperationsNoJobTransient()
+    void testConcurrentDeleteOperationsNoJobTransient()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentDeleteOperations(null);
     }
 
     @Test
-    public void testConcurrentDeleteOperationsForJobTransient()
+    void testConcurrentDeleteOperationsForJobTransient()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentDeleteOperations(new JobID());
     }
@@ -359,8 +336,6 @@ public class BlobServerDeleteTest extends TestLogger {
     private void testConcurrentDeleteOperations(@Nullable final JobID jobId)
             throws IOException, InterruptedException, ExecutionException {
 
-        final Configuration config = new Configuration();
-
         final int concurrentDeleteOperations = 3;
         final ExecutorService executor = Executors.newFixedThreadPool(concurrentDeleteOperations);
 
@@ -369,24 +344,22 @@ public class BlobServerDeleteTest extends TestLogger {
 
         final byte[] data = {1, 2, 3};
 
-        try (final BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             final TransientBlobKey blobKey =
                     (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
 
-            assertTrue(server.getStorageLocation(jobId, blobKey).exists());
+            assertThat(server.getStorageLocation(jobId, blobKey)).exists();
 
             for (int i = 0; i < concurrentDeleteOperations; i++) {
                 CompletableFuture<Void> deleteFuture =
                         CompletableFuture.supplyAsync(
                                 () -> {
                                     try {
-                                        assertTrue(delete(server, jobId, blobKey));
-                                        assertFalse(
-                                                server.getStorageLocation(jobId, blobKey).exists());
+                                        assertThat(delete(server, jobId, blobKey)).isTrue();
+                                        assertThat(server.getStorageLocation(jobId, blobKey))
+                                                .doesNotExist();
                                         return null;
                                     } catch (IOException e) {
                                         throw new CompletionException(
@@ -407,7 +380,7 @@ public class BlobServerDeleteTest extends TestLogger {
             // in case of no lock, one of the delete operations should eventually fail
             waitFuture.get();
 
-            assertFalse(server.getStorageLocation(jobId, blobKey).exists());
+            assertThat(server.getStorageLocation(jobId, blobKey)).doesNotExist();
 
         } finally {
             executor.shutdownNow();
@@ -438,10 +411,10 @@ public class BlobServerDeleteTest extends TestLogger {
         if (blobType == PERMANENT_BLOB) {
             Preconditions.checkNotNull(jobId);
 
-            assertTrue(key instanceof PermanentBlobKey);
+            assertThat(key).isInstanceOf(PermanentBlobKey.class);
             return blobServer.deletePermanent(jobId, (PermanentBlobKey) key);
         } else {
-            assertTrue(key instanceof TransientBlobKey);
+            assertThat(key).isInstanceOf(TransientBlobKey.class);
             return delete(blobServer, jobId, (TransientBlobKey) key);
         }
     }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
index 9ff57281226..5f3c4d1987c 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
@@ -23,24 +23,24 @@ import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
 import org.apache.flink.core.testutils.FlinkAssertions;
 import org.apache.flink.core.testutils.OneShotLatch;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Reference;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
 import org.apache.commons.io.FileUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.nio.file.AccessDeniedException;
+import java.nio.file.Files;
 import java.nio.file.NoSuchFileException;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -61,12 +61,7 @@ import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
 import static org.apache.flink.runtime.blob.BlobUtils.JOB_DIR_PREFIX;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /**
  * Tests how failing GET requests behave in the presence of failures when used with a {@link
@@ -75,29 +70,29 @@ import static org.junit.Assume.assumeTrue;
  * <p>Successful GET requests are tested in conjunction wit the PUT requests by {@link
  * BlobServerPutTest}.
  */
-public class BlobServerGetTest extends TestLogger {
+class BlobServerGetTest {
 
     private final Random rnd = new Random();
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     @Test
-    public void testGetTransientFailsDuringLookup1() throws IOException {
+    void testGetTransientFailsDuringLookup1() throws IOException {
         testGetFailsDuringLookup(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetTransientFailsDuringLookup2() throws IOException {
+    void testGetTransientFailsDuringLookup2() throws IOException {
         testGetFailsDuringLookup(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetTransientFailsDuringLookup3() throws IOException {
+    void testGetTransientFailsDuringLookup3() throws IOException {
         testGetFailsDuringLookup(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testGetPermanentFailsDuringLookup() throws IOException {
+    void testGetPermanentFailsDuringLookup() throws IOException {
         testGetFailsDuringLookup(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -111,11 +106,8 @@ public class BlobServerGetTest extends TestLogger {
     private void testGetFailsDuringLookup(
             @Nullable final JobID jobId1, @Nullable final JobID jobId2, BlobKey.BlobType blobType)
             throws IOException {
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
 
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -123,18 +115,18 @@ public class BlobServerGetTest extends TestLogger {
 
             // put content addressable (like libraries)
             BlobKey key = put(server, jobId1, data, blobType);
-            assertNotNull(key);
+            assertThat(key).isNotNull();
 
             // delete file to make sure that GET requests fail
             File blobFile = server.getStorageLocation(jobId1, key);
-            assertTrue(blobFile.delete());
+            assertThat(blobFile.delete()).isTrue();
 
             // issue a GET request that fails
             verifyDeleted(server, jobId1, key);
 
             // add the same data under a second jobId
             BlobKey key2 = put(server, jobId2, data, blobType);
-            assertNotNull(key2);
+            assertThat(key2).isNotNull();
             verifyKeyDifferentHashEquals(key, key2);
 
             // request for jobId2 should succeed
@@ -144,7 +136,7 @@ public class BlobServerGetTest extends TestLogger {
 
             // same checks as for jobId1 but for jobId2 should also work:
             blobFile = server.getStorageLocation(jobId2, key2);
-            assertTrue(blobFile.delete());
+            assertThat(blobFile.delete()).isTrue();
             verifyDeleted(server, jobId2, key2);
         }
     }
@@ -154,15 +146,15 @@ public class BlobServerGetTest extends TestLogger {
      * files. File transfers should fail.
      */
     @Test
-    public void testGetFailsIncomingForJobHa() throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+    void testGetFailsIncomingForJobHa() throws IOException {
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
         final JobID jobId = new JobID();
 
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, temporaryFolder.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStore = null;
 
@@ -170,22 +162,20 @@ public class BlobServerGetTest extends TestLogger {
             blobStore = BlobUtils.createBlobStoreFromConfig(config);
 
             File tempFileDir = null;
-            try (BlobServer server =
-                    new BlobServer(config, temporaryFolder.newFolder(), blobStore)) {
-
+            try (BlobServer server = TestingBlobUtils.createServer(tempDir, config, blobStore)) {
                 server.start();
 
                 // store the data on the server (and blobStore), remove from local store
                 byte[] data = new byte[2000000];
                 rnd.nextBytes(data);
                 BlobKey blobKey = put(server, jobId, data, PERMANENT_BLOB);
-                assertTrue(server.getStorageLocation(jobId, blobKey).delete());
+                assertThat(server.getStorageLocation(jobId, blobKey).delete()).isTrue();
 
                 // make sure the blob server cannot create any files in its storage dir
                 tempFileDir = server.createTemporaryFilename().getParentFile();
-                assertTrue(tempFileDir.setExecutable(true, false));
-                assertTrue(tempFileDir.setReadable(true, false));
-                assertTrue(tempFileDir.setWritable(false, false));
+                assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+                assertThat(tempFileDir.setReadable(true, false)).isTrue();
+                assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
                 // request the file from the BlobStore
                 try {
@@ -200,12 +190,13 @@ public class BlobServerGetTest extends TestLogger {
                     // only the incoming and job directory should exist (no job directory!)
                     File storageDir = tempFileDir.getParentFile();
                     String[] actualDirs = storageDir.list();
-                    assertNotNull(actualDirs);
-                    assertEquals(expectedDirs, new HashSet<>(Arrays.asList(actualDirs)));
+                    assertThat(actualDirs).isNotNull();
+                    assertThat(actualDirs).isNotEmpty();
+                    assertThat(new HashSet<>(Arrays.asList(actualDirs))).isEqualTo(expectedDirs);
 
                     // job directory should be empty
                     File jobDir = new File(tempFileDir.getParentFile(), JOB_DIR_PREFIX + jobId);
-                    assertArrayEquals(new String[] {}, jobDir.list());
+                    assertThat(jobDir.list()).isEmpty();
                 }
             } finally {
                 // set writable again to make sure we can remove the directory
@@ -226,15 +217,15 @@ public class BlobServerGetTest extends TestLogger {
      * storage file. File transfers should fail.
      */
     @Test
-    public void testGetFailsStoreForJobHa() throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+    void testGetFailsStoreForJobHa() throws IOException {
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
         final JobID jobId = new JobID();
 
         final Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, temporaryFolder.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStore = null;
 
@@ -242,22 +233,20 @@ public class BlobServerGetTest extends TestLogger {
             blobStore = BlobUtils.createBlobStoreFromConfig(config);
 
             File jobStoreDir = null;
-            try (BlobServer server =
-                    new BlobServer(config, temporaryFolder.newFolder(), blobStore)) {
-
+            try (BlobServer server = TestingBlobUtils.createServer(tempDir, config, blobStore)) {
                 server.start();
 
                 // store the data on the server (and blobStore), remove from local store
                 byte[] data = new byte[2000000];
                 rnd.nextBytes(data);
                 BlobKey blobKey = put(server, jobId, data, PERMANENT_BLOB);
-                assertTrue(server.getStorageLocation(jobId, blobKey).delete());
+                assertThat(server.getStorageLocation(jobId, blobKey).delete()).isTrue();
 
                 // make sure the blob cache cannot create any files in its storage dir
                 jobStoreDir = server.getStorageLocation(jobId, blobKey).getParentFile();
-                assertTrue(jobStoreDir.setExecutable(true, false));
-                assertTrue(jobStoreDir.setReadable(true, false));
-                assertTrue(jobStoreDir.setWritable(false, false));
+                assertThat(jobStoreDir.setExecutable(true, false)).isTrue();
+                assertThat(jobStoreDir.setReadable(true, false)).isTrue();
+                assertThat(jobStoreDir.setWritable(false, false)).isTrue();
 
                 // request the file from the BlobStore
                 try {
@@ -266,10 +255,10 @@ public class BlobServerGetTest extends TestLogger {
                 } finally {
                     // there should be no remaining incoming files
                     File incomingFileDir = new File(jobStoreDir.getParent(), "incoming");
-                    assertArrayEquals(new String[] {}, incomingFileDir.list());
+                    assertThat(incomingFileDir.list()).isEmpty();
 
                     // there should be no files in the job directory
-                    assertArrayEquals(new String[] {}, jobStoreDir.list());
+                    assertThat(jobStoreDir.list()).isEmpty();
                 }
             } finally {
                 // set writable again to make sure we can remove the directory
@@ -290,21 +279,17 @@ public class BlobServerGetTest extends TestLogger {
      * the file. File transfers should fail.
      */
     @Test
-    public void testGetFailsHaStoreForJobHa() throws IOException {
+    void testGetFailsHaStoreForJobHa() throws IOException {
         final JobID jobId = new JobID();
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             // store the data on the server (and blobStore), remove from local store
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
             BlobKey blobKey = put(server, jobId, data, PERMANENT_BLOB);
-            assertTrue(server.getStorageLocation(jobId, blobKey).delete());
+            assertThat(server.getStorageLocation(jobId, blobKey).delete()).isTrue();
 
             File tempFileDir = server.createTemporaryFilename().getParentFile();
 
@@ -319,41 +304,42 @@ public class BlobServerGetTest extends TestLogger {
                 // only the incoming and job directory should exist (no job directory!)
                 File storageDir = tempFileDir.getParentFile();
                 String[] actualDirs = storageDir.list();
-                assertNotNull(actualDirs);
-                assertEquals(expectedDirs, new HashSet<>(Arrays.asList(actualDirs)));
+                assertThat(actualDirs).isNotNull();
+                assertThat(actualDirs).isNotEmpty();
+                assertThat(new HashSet<>(Arrays.asList(actualDirs))).isEqualTo(expectedDirs);
 
                 // job directory should be empty
                 File jobDir = new File(tempFileDir.getParentFile(), JOB_DIR_PREFIX + jobId);
-                assertArrayEquals(new String[] {}, jobDir.list());
+                assertThat(jobDir.list()).isEmpty();
             }
         }
     }
 
     @Test
-    public void testConcurrentGetOperationsNoJob()
+    void testConcurrentGetOperationsNoJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentGetOperationsForJob()
+    void testConcurrentGetOperationsForJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentGetOperationsForJobHa()
+    void testConcurrentGetOperationsForJobHa()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentGetOperations(new JobID(), PERMANENT_BLOB);
     }
 
     @Test
-    public void testGetChecksForCorruptionInPermanentBlobInCaseOfRestart() throws IOException {
+    void testGetChecksForCorruptionInPermanentBlobInCaseOfRestart() throws IOException {
         runGetChecksForCorruptionInCaseOfRestartTest(PERMANENT_BLOB);
     }
 
     @Test
-    public void testGetChecksForCorruptionInTransientBlobInCaseOfRestart() throws IOException {
+    void testGetChecksForCorruptionInTransientBlobInCaseOfRestart() throws IOException {
         runGetChecksForCorruptionInCaseOfRestartTest(TRANSIENT_BLOB);
     }
 
@@ -363,7 +349,7 @@ public class BlobServerGetTest extends TestLogger {
         final byte[] data = new byte[] {1, 2, 3};
         final byte[] corruptedData = new byte[] {3, 2, 1};
 
-        final File storageDir = temporaryFolder.newFolder();
+        final File storageDir = TempDirUtils.newFolder(tempDir);
         try (final BlobServer blobServer =
                 new BlobServer(
                         new Configuration(), Reference.borrowed(storageDir), new VoidBlobStore())) {
@@ -380,25 +366,19 @@ public class BlobServerGetTest extends TestLogger {
                             new Configuration(),
                             Reference.borrowed(storageDir),
                             new VoidBlobStore())) {
-                try {
-                    // the file should be corrupted now
-                    get(restartedBlobServer, jobId, blobKey);
-                    fail("Expected to fail with an IOException because the file is corrupted.");
-                } catch (IOException expected) {
-                    // expected :-)
-                }
+                assertThatThrownBy(() -> get(restartedBlobServer, jobId, blobKey))
+                        .isInstanceOf(IOException.class);
             }
         }
     }
 
     @Test
-    public void testGetReDownloadsCorruptedPermanentBlobFromBlobStoreInCaseOfRestart()
-            throws IOException {
+    void testGetReDownloadsCorruptedPermanentBlobFromBlobStoreInCaseOfRestart() throws IOException {
         final JobID jobId = JobID.generate();
         final byte[] data = new byte[] {1, 2, 3};
         final byte[] corruptedData = new byte[] {3, 2, 1};
 
-        final File storageDir = temporaryFolder.newFolder();
+        final File storageDir = TempDirUtils.newFolder(tempDir);
         final OneShotLatch getCalled = new OneShotLatch();
         final BlobStore blobStore =
                 new TestingBlobStoreBuilder()
@@ -424,7 +404,7 @@ public class BlobServerGetTest extends TestLogger {
                             new Configuration(), Reference.borrowed(storageDir), blobStore)) {
                 // we should re-download the file from the BlobStore
                 final File file = get(restartedBlobServer, jobId, blobKey);
-                validateGetAndClose(new FileInputStream(file), data);
+                validateGetAndClose(Files.newInputStream(file.toPath()), data);
                 assertThat(getCalled.isTriggered()).isTrue();
             }
         }
@@ -459,7 +439,7 @@ public class BlobServerGetTest extends TestLogger {
                 Executors.newFixedThreadPool(numberConcurrentGetOperations);
 
         try (final BlobServer server =
-                new BlobServer(new Configuration(), temporaryFolder.newFolder(), blobStore)) {
+                TestingBlobUtils.createServer(tempDir, new Configuration(), blobStore)) {
 
             server.start();
 
@@ -470,7 +450,7 @@ public class BlobServerGetTest extends TestLogger {
             // store!)
             if (blobType == PERMANENT_BLOB) {
                 // remove local copy so that a transfer from HA store takes place
-                assertTrue(server.getStorageLocation(jobId, blobKey).delete());
+                assertThat(server.getStorageLocation(jobId, blobKey).delete()).isTrue();
             }
             for (int i = 0; i < numberConcurrentGetOperations; i++) {
                 CompletableFuture<File> getOperation =
@@ -479,7 +459,8 @@ public class BlobServerGetTest extends TestLogger {
                                     try {
                                         File file = get(server, jobId, blobKey);
                                         // check that we have read the right data
-                                        validateGetAndClose(new FileInputStream(file), data);
+                                        validateGetAndClose(
+                                                Files.newInputStream(file.toPath()), data);
                                         return file;
                                     } catch (IOException e) {
                                         throw new CompletionException(
@@ -532,13 +513,7 @@ public class BlobServerGetTest extends TestLogger {
      * @param jobId job ID or <tt>null</tt> if job-unrelated
      * @param key key identifying the BLOB to request
      */
-    static void verifyDeleted(BlobService service, @Nullable JobID jobId, BlobKey key)
-            throws IOException {
-        try {
-            get(service, jobId, key);
-            fail("File " + jobId + "/" + key + " should have been deleted.");
-        } catch (IOException e) {
-            // expected
-        }
+    static void verifyDeleted(BlobService service, @Nullable JobID jobId, BlobKey key) {
+        assertThatThrownBy(() -> get(service, jobId, key)).isInstanceOf(IOException.class);
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
index e3154c56ebd..1f1f26cedc0 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
@@ -22,23 +22,20 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.core.testutils.CheckedThread;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Preconditions;
-import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.concurrent.FutureUtils;
 
 import org.apache.commons.io.FileUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
@@ -65,24 +62,18 @@ import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
 import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
 import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /**
  * Tests for successful and failing PUT operations against the BLOB server, and successful GET
  * operations.
  */
-public class BlobServerPutTest extends TestLogger {
+class BlobServerPutTest {
 
-    private final Random rnd = new Random();
-
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private java.nio.file.Path tempDir;
 
-    @Rule public final ExpectedException exception = ExpectedException.none();
+    private final Random rnd = new Random();
 
     // --- concurrency tests for utility methods which could fail during the put operation ---
 
@@ -107,23 +98,20 @@ public class BlobServerPutTest extends TestLogger {
 
     /** Tests concurrent calls to {@link BlobServer#getStorageLocation(JobID, BlobKey)}. */
     @Test
-    public void testServerContentAddressableGetStorageLocationConcurrentNoJob() throws Exception {
+    void testServerContentAddressableGetStorageLocationConcurrentNoJob() throws Exception {
         testServerContentAddressableGetStorageLocationConcurrent(null);
     }
 
     /** Tests concurrent calls to {@link BlobServer#getStorageLocation(JobID, BlobKey)}. */
     @Test
-    public void testServerContentAddressableGetStorageLocationConcurrentForJob() throws Exception {
+    void testServerContentAddressableGetStorageLocationConcurrentForJob() throws Exception {
         testServerContentAddressableGetStorageLocationConcurrent(new JobID());
     }
 
     private void testServerContentAddressableGetStorageLocationConcurrent(
             @Nullable final JobID jobId) throws Exception {
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
 
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             BlobKey key1 = new TransientBlobKey();
@@ -163,27 +151,27 @@ public class BlobServerPutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutBufferSuccessfulGet1() throws IOException {
+    void testPutBufferSuccessfulGet1() throws IOException {
         testPutBufferSuccessfulGet(null, null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferSuccessfulGet2() throws IOException {
+    void testPutBufferSuccessfulGet2() throws IOException {
         testPutBufferSuccessfulGet(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferSuccessfulGet3() throws IOException {
+    void testPutBufferSuccessfulGet3() throws IOException {
         testPutBufferSuccessfulGet(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferSuccessfulGet4() throws IOException {
+    void testPutBufferSuccessfulGet4() throws IOException {
         testPutBufferSuccessfulGet(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferSuccessfulGetHa() throws IOException {
+    void testPutBufferSuccessfulGetHa() throws IOException {
         testPutBufferSuccessfulGet(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -199,11 +187,7 @@ public class BlobServerPutTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2, BlobKey.BlobType blobType)
             throws IOException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -212,14 +196,14 @@ public class BlobServerPutTest extends TestLogger {
 
             // put data for jobId1 and verify
             BlobKey key1a = put(server, jobId1, data, blobType);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(server, jobId1, data, blobType);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             BlobKey key1b = put(server, jobId1, data2, blobType);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
 
             verifyContents(server, jobId1, key1a, data);
             verifyContents(server, jobId1, key1a2, data);
@@ -227,11 +211,11 @@ public class BlobServerPutTest extends TestLogger {
 
             // now put data for jobId2 and verify that both are ok
             BlobKey key2a = put(server, jobId2, data, blobType);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             BlobKey key2b = put(server, jobId2, data2, blobType);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyKeyDifferentHashEquals(key1b, key2b);
 
             // verify the accessibility and the BLOB contents
@@ -251,27 +235,27 @@ public class BlobServerPutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutStreamSuccessfulGet1() throws IOException {
+    void testPutStreamSuccessfulGet1() throws IOException {
         testPutStreamSuccessfulGet(null, null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutStreamSuccessfulGet2() throws IOException {
+    void testPutStreamSuccessfulGet2() throws IOException {
         testPutStreamSuccessfulGet(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutStreamSuccessfulGet3() throws IOException {
+    void testPutStreamSuccessfulGet3() throws IOException {
         testPutStreamSuccessfulGet(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutStreamSuccessfulGet4() throws IOException {
+    void testPutStreamSuccessfulGet4() throws IOException {
         testPutStreamSuccessfulGet(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutStreamSuccessfulGetHa() throws IOException {
+    void testPutStreamSuccessfulGetHa() throws IOException {
         testPutStreamSuccessfulGet(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -287,11 +271,7 @@ public class BlobServerPutTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2, BlobKey.BlobType blobType)
             throws IOException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -300,14 +280,14 @@ public class BlobServerPutTest extends TestLogger {
 
             // put data for jobId1 and verify
             BlobKey key1a = put(server, jobId1, new ByteArrayInputStream(data), blobType);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(server, jobId1, new ByteArrayInputStream(data), blobType);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             BlobKey key1b = put(server, jobId1, new ByteArrayInputStream(data2), blobType);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
 
             verifyContents(server, jobId1, key1a, data);
             verifyContents(server, jobId1, key1a2, data);
@@ -315,11 +295,11 @@ public class BlobServerPutTest extends TestLogger {
 
             // now put data for jobId2 and verify that both are ok
             BlobKey key2a = put(server, jobId2, new ByteArrayInputStream(data), blobType);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             BlobKey key2b = put(server, jobId2, new ByteArrayInputStream(data2), blobType);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyKeyDifferentHashEquals(key1b, key2b);
 
             // verify the accessibility and the BLOB contents
@@ -339,27 +319,27 @@ public class BlobServerPutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutChunkedStreamSuccessfulGet1() throws IOException {
+    void testPutChunkedStreamSuccessfulGet1() throws IOException {
         testPutChunkedStreamSuccessfulGet(null, null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutChunkedStreamSuccessfulGet2() throws IOException {
+    void testPutChunkedStreamSuccessfulGet2() throws IOException {
         testPutChunkedStreamSuccessfulGet(null, new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutChunkedStreamSuccessfulGet3() throws IOException {
+    void testPutChunkedStreamSuccessfulGet3() throws IOException {
         testPutChunkedStreamSuccessfulGet(new JobID(), new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutChunkedStreamSuccessfulGet4() throws IOException {
+    void testPutChunkedStreamSuccessfulGet4() throws IOException {
         testPutChunkedStreamSuccessfulGet(new JobID(), null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutChunkedStreamSuccessfulGetHa() throws IOException {
+    void testPutChunkedStreamSuccessfulGetHa() throws IOException {
         testPutChunkedStreamSuccessfulGet(new JobID(), new JobID(), PERMANENT_BLOB);
     }
 
@@ -375,11 +355,7 @@ public class BlobServerPutTest extends TestLogger {
             @Nullable JobID jobId1, @Nullable JobID jobId2, BlobKey.BlobType blobType)
             throws IOException {
 
-        final Configuration config = new Configuration();
-
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             byte[] data = new byte[2000000];
@@ -388,14 +364,14 @@ public class BlobServerPutTest extends TestLogger {
 
             // put data for jobId1 and verify
             BlobKey key1a = put(server, jobId1, new ChunkedInputStream(data, 19), blobType);
-            assertNotNull(key1a);
+            assertThat(key1a).isNotNull();
             // second upload of same data should yield a different BlobKey
             BlobKey key1a2 = put(server, jobId1, new ChunkedInputStream(data, 19), blobType);
-            assertNotNull(key1a2);
+            assertThat(key1a2).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key1a2);
 
             BlobKey key1b = put(server, jobId1, new ChunkedInputStream(data2, 19), blobType);
-            assertNotNull(key1b);
+            assertThat(key1b).isNotNull();
 
             verifyContents(server, jobId1, key1a, data);
             verifyContents(server, jobId1, key1a2, data);
@@ -403,11 +379,11 @@ public class BlobServerPutTest extends TestLogger {
 
             // now put data for jobId2 and verify that both are ok
             BlobKey key2a = put(server, jobId2, new ChunkedInputStream(data, 19), blobType);
-            assertNotNull(key2a);
+            assertThat(key2a).isNotNull();
             verifyKeyDifferentHashEquals(key1a, key2a);
 
             BlobKey key2b = put(server, jobId2, new ChunkedInputStream(data2, 19), blobType);
-            assertNotNull(key2b);
+            assertThat(key2b).isNotNull();
             verifyKeyDifferentHashEquals(key1b, key2b);
 
             // verify the accessibility and the BLOB contents
@@ -427,17 +403,17 @@ public class BlobServerPutTest extends TestLogger {
     // --------------------------------------------------------------------------------------------
 
     @Test
-    public void testPutBufferFailsNoJob() throws IOException {
+    void testPutBufferFailsNoJob() throws IOException {
         testPutBufferFails(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsForJob() throws IOException {
+    void testPutBufferFailsForJob() throws IOException {
         testPutBufferFails(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsForJobHa() throws IOException {
+    void testPutBufferFailsForJobHa() throws IOException {
         testPutBufferFails(new JobID(), PERMANENT_BLOB);
     }
 
@@ -450,51 +426,41 @@ public class BlobServerPutTest extends TestLogger {
      */
     private void testPutBufferFails(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
-
-        final Configuration config = new Configuration();
-
-        File tempFileDir = null;
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
-            tempFileDir = server.createTemporaryFilename().getParentFile().getParentFile();
-            assertTrue(tempFileDir.setExecutable(true, false));
-            assertTrue(tempFileDir.setReadable(true, false));
-            assertTrue(tempFileDir.setWritable(false, false));
+            File tempFileDir = server.createTemporaryFilename().getParentFile().getParentFile();
+            assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+            assertThat(tempFileDir.setReadable(true, false)).isTrue();
+            assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
             // upload the file to the server directly
-            exception.expect(AccessDeniedException.class);
-
-            put(server, jobId, data, blobType);
+            assertThatThrownBy(() -> put(server, jobId, data, blobType))
+                    .isInstanceOf(AccessDeniedException.class);
 
-        } finally {
             // set writable again to make sure we can remove the directory
-            if (tempFileDir != null) {
-                //noinspection ResultOfMethodCallIgnored
-                tempFileDir.setWritable(true, false);
-            }
+            assertThat(tempFileDir.setWritable(true, false)).isTrue();
         }
     }
 
     @Test
-    public void testPutBufferFailsIncomingNoJob() throws IOException {
+    void testPutBufferFailsIncomingNoJob() throws IOException {
         testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsIncomingForJob() throws IOException {
+    void testPutBufferFailsIncomingForJob() throws IOException {
         testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsIncomingForJobHa() throws IOException {
+    void testPutBufferFailsIncomingForJobHa() throws IOException {
         testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
     }
 
@@ -507,35 +473,30 @@ public class BlobServerPutTest extends TestLogger {
      */
     private void testPutBufferFailsIncoming(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
-
-        final Configuration config = new Configuration();
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
         File tempFileDir = null;
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
             tempFileDir = server.createTemporaryFilename().getParentFile();
-            assertTrue(tempFileDir.setExecutable(true, false));
-            assertTrue(tempFileDir.setReadable(true, false));
-            assertTrue(tempFileDir.setWritable(false, false));
+            assertThat(tempFileDir.setExecutable(true, false)).isTrue();
+            assertThat(tempFileDir.setReadable(true, false)).isTrue();
+            assertThat(tempFileDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
-            // upload the file to the server directly
-            exception.expect(IOException.class);
-            exception.expectMessage(" (Permission denied)");
-
             try {
-                put(server, jobId, data, blobType);
+                // upload the file to the server directly
+                assertThatThrownBy(() -> put(server, jobId, data, blobType))
+                        .isInstanceOf(IOException.class)
+                        .hasMessageEndingWith(" (Permission denied)");
             } finally {
                 File storageDir = tempFileDir.getParentFile();
                 // only the incoming directory should exist (no job directory!)
-                assertArrayEquals(new String[] {"incoming"}, storageDir.list());
+                assertThat(storageDir.list()).containsExactly("incoming");
             }
         } finally {
             // set writable again to make sure we can remove the directory
@@ -547,17 +508,17 @@ public class BlobServerPutTest extends TestLogger {
     }
 
     @Test
-    public void testPutBufferFailsStoreNoJob() throws IOException {
+    void testPutBufferFailsStoreNoJob() throws IOException {
         testPutBufferFailsStore(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsStoreForJob() throws IOException {
+    void testPutBufferFailsStoreForJob() throws IOException {
         testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testPutBufferFailsStoreForJobHa() throws IOException {
+    void testPutBufferFailsStoreForJobHa() throws IOException {
         testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
     }
 
@@ -570,38 +531,33 @@ public class BlobServerPutTest extends TestLogger {
      */
     private void testPutBufferFailsStore(@Nullable final JobID jobId, BlobKey.BlobType blobType)
             throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
-
-        final Configuration config = new Configuration();
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
         File jobStoreDir = null;
-        try (BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), new VoidBlobStore())) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir)) {
             server.start();
 
             // make sure the blob server cannot create any files in its storage dir
             jobStoreDir =
                     server.getStorageLocation(jobId, BlobKey.createKey(blobType)).getParentFile();
-            assertTrue(jobStoreDir.setExecutable(true, false));
-            assertTrue(jobStoreDir.setReadable(true, false));
-            assertTrue(jobStoreDir.setWritable(false, false));
+            assertThat(jobStoreDir.setExecutable(true, false)).isTrue();
+            assertThat(jobStoreDir.setReadable(true, false)).isTrue();
+            assertThat(jobStoreDir.setWritable(false, false)).isTrue();
 
             byte[] data = new byte[2000000];
             rnd.nextBytes(data);
 
-            // upload the file to the server directly
-            exception.expect(AccessDeniedException.class);
-
             try {
-                put(server, jobId, data, blobType);
+                // upload the file to the server directly
+                assertThatThrownBy(() -> put(server, jobId, data, blobType))
+                        .isInstanceOf(AccessDeniedException.class);
             } finally {
                 // there should be no remaining incoming files
                 File incomingFileDir = new File(jobStoreDir.getParent(), "incoming");
-                assertArrayEquals(new String[] {}, incomingFileDir.list());
+                assertThat(incomingFileDir.list()).isEmpty();
 
                 // there should be no files in the job directory
-                assertArrayEquals(new String[] {}, jobStoreDir.list());
+                assertThat(jobStoreDir.list()).isEmpty();
             }
         } finally {
             // set writable again to make sure we can remove the directory
@@ -613,30 +569,30 @@ public class BlobServerPutTest extends TestLogger {
     }
 
     @Test
-    public void testConcurrentPutOperationsNoJob()
+    void testConcurrentPutOperationsNoJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(null, TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentPutOperationsForJob()
+    void testConcurrentPutOperationsForJob()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(new JobID(), TRANSIENT_BLOB);
     }
 
     @Test
-    public void testConcurrentPutOperationsForJobHa()
+    void testConcurrentPutOperationsForJobHa()
             throws IOException, ExecutionException, InterruptedException {
         testConcurrentPutOperations(new JobID(), PERMANENT_BLOB);
     }
 
     @Test
-    public void testFailedBlobStorePutsDeletesLocalBlob() throws IOException {
+    void testFailedBlobStorePutsDeletesLocalBlob() throws IOException {
         final BlobKey.BlobType blobType = PERMANENT_BLOB;
         final JobID jobId = JobID.generate();
         final byte[] data = new byte[] {1, 2, 3};
 
-        final File storageDir = temporaryFolder.newFolder();
+        final File storageDir = TempDirUtils.newFolder(tempDir);
         final TestingBlobStore blobStore =
                 new TestingBlobStoreBuilder()
                         .setPutFunction(
@@ -646,12 +602,8 @@ public class BlobServerPutTest extends TestLogger {
                         .createTestingBlobStore();
         try (final BlobServer blobServer =
                 new BlobServer(new Configuration(), storageDir, blobStore)) {
-            try {
-                put(blobServer, jobId, data, blobType);
-                fail("Expected that the put operation fails with an IOException.");
-            } catch (IOException expected) {
-                // expected :-)
-            }
+            assertThatThrownBy(() -> put(blobServer, jobId, data, blobType))
+                    .isInstanceOf(IOException.class);
 
             final File jobSpecificStorageDirectory =
                     new File(BlobUtils.getStorageLocationPath(storageDir.getAbsolutePath(), jobId));
@@ -691,9 +643,7 @@ public class BlobServerPutTest extends TestLogger {
 
         ExecutorService executor = Executors.newFixedThreadPool(concurrentPutOperations);
 
-        try (final BlobServer server =
-                new BlobServer(config, temporaryFolder.newFolder(), blobStore)) {
-
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir, config, blobStore)) {
             server.start();
 
             for (int i = 0; i < concurrentPutOperations; i++) {
@@ -726,7 +676,7 @@ public class BlobServerPutTest extends TestLogger {
 
             Iterator<BlobKey> blobKeyIterator = blobKeys.iterator();
 
-            assertTrue(blobKeyIterator.hasNext());
+            assertThat(blobKeyIterator).hasNext();
 
             BlobKey blobKey = blobKeyIterator.next();
 
@@ -803,7 +753,7 @@ public class BlobServerPutTest extends TestLogger {
                             Collections.singletonList(new Path(tmpFile.getAbsolutePath()));
                     List<PermanentBlobKey> keys =
                             BlobClient.uploadFiles(serverAddress, clientConfig, jobId, jars);
-                    assertEquals(1, keys.size());
+                    assertThat(keys).hasSize(1);
                     return keys.get(0);
                 } finally {
                     //noinspection ResultOfMethodCallIgnored
@@ -830,7 +780,7 @@ public class BlobServerPutTest extends TestLogger {
             throws IOException {
 
         File file = get(blobService, jobId, key);
-        validateGetAndClose(new FileInputStream(file), data);
+        validateGetAndClose(Files.newInputStream(file.toPath()), data);
     }
 
     /**
@@ -846,7 +796,7 @@ public class BlobServerPutTest extends TestLogger {
             throws IOException {
 
         File file = get(blobService, jobId, key);
-        validateGetAndClose(new FileInputStream(file), data);
+        validateGetAndClose(Files.newInputStream(file.toPath()), data);
     }
 
     // --------------------------------------------------------------------------------------------
@@ -924,7 +874,7 @@ public class BlobServerPutTest extends TestLogger {
         }
 
         @Override
-        public int read(byte[] b, int off, int len) throws IOException {
+        public int read(byte[] b, int off, int len) {
             if (len == 0) {
                 return 0;
             }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRangeTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRangeTest.java
index 5f56d123248..5bdc540b6f0 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRangeTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRangeTest.java
@@ -20,47 +20,44 @@ package org.apache.flink.runtime.blob;
 
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import java.io.IOException;
 import java.net.ServerSocket;
+import java.nio.file.Path;
 
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.hamcrest.Matchers.lessThanOrEqualTo;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
 
 /** Tests to ensure that the BlobServer properly starts on a specified range of available ports. */
-public class BlobServerRangeTest extends TestLogger {
+class BlobServerRangeTest {
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir private Path tempDir;
 
     /** Start blob server on 0 = pick an ephemeral port. */
     @Test
-    public void testOnEphemeralPort() throws IOException {
+    void testOnEphemeralPort() throws IOException {
         Configuration conf = new Configuration();
         conf.setString(BlobServerOptions.PORT, "0");
 
-        BlobServer server = new BlobServer(conf, temporaryFolder.newFolder(), new VoidBlobStore());
+        BlobServer server = TestingBlobUtils.createServer(tempDir, conf);
         server.start();
         server.close();
     }
 
     /** Try allocating on an unavailable port. */
-    @Test(expected = IOException.class)
-    public void testPortUnavailable() throws IOException {
+    @Test
+    void testPortUnavailable() throws IOException {
         // allocate on an ephemeral port
         ServerSocket socket = null;
         try {
             socket = new ServerSocket(0);
         } catch (IOException e) {
             e.printStackTrace();
-            Assert.fail("An exception was thrown while preparing the test " + e.getMessage());
+            fail("An exception was thrown while preparing the test " + e.getMessage());
         }
 
         Configuration conf = new Configuration();
@@ -68,9 +65,9 @@ public class BlobServerRangeTest extends TestLogger {
 
         // this thing is going to throw an exception
         try {
-            BlobServer server =
-                    new BlobServer(conf, temporaryFolder.newFolder(), new VoidBlobStore());
-            server.start();
+            assertThatThrownBy(() -> TestingBlobUtils.createServer(tempDir, conf))
+                    .isInstanceOf(IOException.class)
+                    .hasMessageStartingWith("Unable to open BLOB Server in specified port range: ");
         } finally {
             socket.close();
         }
@@ -78,7 +75,7 @@ public class BlobServerRangeTest extends TestLogger {
 
     /** Give the BlobServer a choice of three ports, where two of them are allocated. */
     @Test
-    public void testOnePortAvailable() throws IOException {
+    void testOnePortAvailable() throws IOException {
         int numAllocated = 2;
         ServerSocket[] sockets = new ServerSocket[numAllocated];
         for (int i = 0; i < numAllocated; i++) {
@@ -86,7 +83,7 @@ public class BlobServerRangeTest extends TestLogger {
                 sockets[i] = new ServerSocket(0);
             } catch (IOException e) {
                 e.printStackTrace();
-                Assert.fail("An exception was thrown while preparing the test " + e.getMessage());
+                fail("An exception was thrown while preparing the test " + e.getMessage());
             }
         }
         Configuration conf = new Configuration();
@@ -96,11 +93,9 @@ public class BlobServerRangeTest extends TestLogger {
 
         // this thing is going to throw an exception
         try {
-            BlobServer server =
-                    new BlobServer(conf, temporaryFolder.newFolder(), new VoidBlobStore());
+            BlobServer server = TestingBlobUtils.createServer(tempDir, conf);
             server.start();
-            assertThat(
-                    server.getPort(), allOf(greaterThanOrEqualTo(50000), lessThanOrEqualTo(50050)));
+            assertThat(server.getPort()).isBetween(50000, 50050);
             server.close();
         } finally {
             for (int i = 0; i < numAllocated; ++i) {
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRecoveryTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRecoveryTest.java
index 5f3e6c5e84c..31de327709a 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRecoveryTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerRecoveryTest.java
@@ -18,39 +18,18 @@
 
 package org.apache.flink.runtime.blob;
 
-import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
-import org.apache.flink.core.fs.FileSystem;
-import org.apache.flink.core.fs.Path;
 import org.apache.flink.runtime.jobmanager.HighAvailabilityMode;
-import org.apache.flink.util.TestLogger;
-import org.apache.flink.util.concurrent.Executors;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Random;
-
-import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
-import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
-import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
-import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 /** Tests for the recovery of files of a {@link BlobServer} from a HA store. */
-public class BlobServerRecoveryTest extends TestLogger {
+class BlobServerRecoveryTest {
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir private java.nio.file.Path tempDir;
 
     /**
      * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed JARs are recoverable from
@@ -61,101 +40,19 @@ public class BlobServerRecoveryTest extends TestLogger {
         Configuration config = new Configuration();
         config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
         config.setString(
-                HighAvailabilityOptions.HA_STORAGE_PATH, TEMPORARY_FOLDER.newFolder().getPath());
+                HighAvailabilityOptions.HA_STORAGE_PATH, TempDirUtils.newFolder(tempDir).getPath());
 
         BlobStoreService blobStoreService = null;
 
         try {
             blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
 
-            testBlobServerRecovery(config, blobStoreService, TEMPORARY_FOLDER.newFolder());
+            TestingBlobHelpers.testBlobServerRecovery(
+                    config, blobStoreService, TempDirUtils.newFolder(tempDir));
         } finally {
             if (blobStoreService != null) {
                 blobStoreService.closeAndCleanupAllData();
             }
         }
     }
-
-    /**
-     * Helper to test that the {@link BlobServer} recovery from its HA store works.
-     *
-     * <p>Uploads two BLOBs to one {@link BlobServer} and expects a second one to be able to
-     * retrieve them via a shared HA store upon request of a {@link BlobCacheService}.
-     *
-     * @param config blob server configuration (including HA settings like {@link
-     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
-     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
-     * @param blobStore shared HA blob store to use
-     * @throws IOException in case of failures
-     */
-    public static void testBlobServerRecovery(
-            final Configuration config, final BlobStore blobStore, final File blobStorage)
-            throws Exception {
-        final String clusterId = config.getString(HighAvailabilityOptions.HA_CLUSTER_ID);
-        String storagePath =
-                config.getString(HighAvailabilityOptions.HA_STORAGE_PATH) + "/" + clusterId;
-        Random rand = new Random();
-
-        try (BlobServer server0 =
-                        new BlobServer(config, new File(blobStorage, "server0"), blobStore);
-                BlobServer server1 =
-                        new BlobServer(config, new File(blobStorage, "server1"), blobStore);
-                // use VoidBlobStore as the HA store to force download from server[1]'s HA store
-                BlobCacheService cache1 =
-                        new BlobCacheService(
-                                config,
-                                new File(blobStorage, "cache1"),
-                                new VoidBlobStore(),
-                                new InetSocketAddress("localhost", server1.getPort()))) {
-
-            server0.start();
-            server1.start();
-
-            // Random data
-            byte[] expected = new byte[1024];
-            rand.nextBytes(expected);
-            byte[] expected2 = Arrays.copyOfRange(expected, 32, 288);
-
-            BlobKey[] keys = new BlobKey[2];
-            BlobKey nonHAKey;
-
-            // Put job-related HA data
-            JobID[] jobId = new JobID[] {new JobID(), new JobID()};
-            keys[0] = put(server0, jobId[0], expected, PERMANENT_BLOB); // Request 1
-            keys[1] = put(server0, jobId[1], expected2, PERMANENT_BLOB); // Request 2
-
-            // put non-HA data
-            nonHAKey = put(server0, jobId[0], expected2, TRANSIENT_BLOB);
-            verifyKeyDifferentHashEquals(keys[1], nonHAKey);
-
-            // check that the storage directory exists
-            final Path blobServerPath = new Path(storagePath, "blob");
-            FileSystem fs = blobServerPath.getFileSystem();
-            assertTrue("Unknown storage dir: " + blobServerPath, fs.exists(blobServerPath));
-
-            // Verify HA requests from cache1 (connected to server1) with no immediate access to the
-            // file
-            verifyContents(cache1, jobId[0], keys[0], expected);
-            verifyContents(cache1, jobId[1], keys[1], expected2);
-
-            // Verify non-HA file is not accessible from server1
-            verifyDeleted(cache1, jobId[0], nonHAKey);
-
-            // Remove again
-            server1.globalCleanupAsync(jobId[0], Executors.directExecutor()).join();
-            server1.globalCleanupAsync(jobId[1], Executors.directExecutor()).join();
-
-            // Verify everything is clean
-            assertTrue("HA storage directory does not exist", fs.exists(new Path(storagePath)));
-            if (fs.exists(blobServerPath)) {
-                final org.apache.flink.core.fs.FileStatus[] recoveryFiles =
-                        fs.listStatus(blobServerPath);
-                ArrayList<String> filenames = new ArrayList<>(recoveryFiles.length);
-                for (org.apache.flink.core.fs.FileStatus file : recoveryFiles) {
-                    filenames.add(file.toString());
-                }
-                fail("Unclean state backend: " + filenames);
-            }
-        }
-    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSSLTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSslTest.java
similarity index 63%
rename from flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSSLTest.java
rename to flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSslTest.java
index 984c96a34cc..2b25549c2fb 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSSLTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerSslTest.java
@@ -20,22 +20,19 @@ package org.apache.flink.runtime.blob;
 
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.SecurityOptions;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
 
-import static org.apache.flink.util.ExceptionUtils.findThrowable;
-import static org.apache.flink.util.ExceptionUtils.findThrowableWithMessage;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Testing a {@link BlobServer} would fail with improper SSL config. */
-public class BlobServerSSLTest extends TestLogger {
+class BlobServerSslTest {
 
     @Test
-    public void testFailedToInitWithTwoProtocolsSet() {
+    void testFailedToInitWithTwoProtocolsSet() {
         final Configuration config = new Configuration();
 
         config.setBoolean(SecurityOptions.SSL_INTERNAL_ENABLED, true);
@@ -51,17 +48,13 @@ public class BlobServerSSLTest extends TestLogger {
         config.setString(SecurityOptions.SSL_TRUSTSTORE_PASSWORD, "password");
         config.setString(SecurityOptions.SSL_ALGORITHMS, "TLSv1,TLSv1.1");
 
-        try (final BlobServer ignored =
-                new BlobServer(config, new File("foobar"), new VoidBlobStore())) {
-            fail();
-        } catch (Exception e) {
-            findThrowable(e, IOException.class);
-            findThrowableWithMessage(e, "Unable to open BLOB Server in specified port range: 0");
-        }
+        assertThatThrownBy(() -> new BlobServer(config, new File("foobar"), new VoidBlobStore()))
+                .isInstanceOf(IOException.class)
+                .hasMessage("Unable to open BLOB Server in specified port range: 0");
     }
 
     @Test
-    public void testFailedToInitWithInvalidSslKeystoreConfigured() {
+    void testFailedToInitWithInvalidSslKeystoreConfigured() {
         final Configuration config = new Configuration();
 
         config.setBoolean(SecurityOptions.SSL_INTERNAL_ENABLED, true);
@@ -71,27 +64,19 @@ public class BlobServerSSLTest extends TestLogger {
         config.setString(SecurityOptions.SSL_TRUSTSTORE, "invalid.keystore");
         config.setString(SecurityOptions.SSL_TRUSTSTORE_PASSWORD, "password");
 
-        try (final BlobServer ignored =
-                new BlobServer(config, new File("foobar"), new VoidBlobStore())) {
-            fail();
-        } catch (Exception e) {
-            findThrowable(e, IOException.class);
-            findThrowableWithMessage(e, "Failed to initialize SSL for the blob server");
-        }
+        assertThatThrownBy(() -> new BlobServer(config, new File("foobar"), new VoidBlobStore()))
+                .isInstanceOf(IOException.class)
+                .hasMessage("Failed to initialize SSL for the blob server");
     }
 
     @Test
-    public void testFailedToInitWithMissingMandatorySslConfiguration() {
+    void testFailedToInitWithMissingMandatorySslConfiguration() {
         final Configuration config = new Configuration();
 
         config.setBoolean(SecurityOptions.SSL_INTERNAL_ENABLED, true);
 
-        try (final BlobServer ignored =
-                new BlobServer(config, new File("foobar"), new VoidBlobStore())) {
-            fail();
-        } catch (Exception e) {
-            findThrowable(e, IOException.class);
-            findThrowableWithMessage(e, "Failed to initialize SSL for the blob server");
-        }
+        assertThatThrownBy(() -> new BlobServer(config, new File("foobar"), new VoidBlobStore()))
+                .isInstanceOf(IOException.class)
+                .hasMessage("Failed to initialize SSL for the blob server");
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
index 336389866aa..624f9ed94cb 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
@@ -22,78 +22,78 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.OperatingSystem;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assumptions.assumeThat;
 
 /** Tests for {@link BlobUtils} working on non-writable directories. */
-public class BlobUtilsNonWritableTest extends TestLogger {
+class BlobUtilsNonWritableTest {
 
     private static final String CANNOT_CREATE_THIS = "cannot-create-this";
 
-    private File blobUtilsTestDirectory;
+    @TempDir private Path tempDir;
 
-    @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-    @Before
-    public void before() throws IOException {
-        assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.
+    @BeforeEach
+    void before() {
+        assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
 
         // Prepare test directory
-        blobUtilsTestDirectory = temporaryFolder.newFolder();
-        assertTrue(blobUtilsTestDirectory.setExecutable(true, false));
-        assertTrue(blobUtilsTestDirectory.setReadable(true, false));
-        assertTrue(blobUtilsTestDirectory.setWritable(false, false));
-    }
-
-    @After
-    public void after() {
-        // Cleanup test directory, ensure it was empty
-        assertTrue(blobUtilsTestDirectory.delete());
+        assertThat(tempDir.toFile().setExecutable(true, false)).isTrue();
+        assertThat(tempDir.toFile().setReadable(true, false)).isTrue();
+        assertThat(tempDir.toFile().setWritable(false, false)).isTrue();
     }
 
-    @Test(expected = IOException.class)
-    public void testExceptionOnCreateStorageDirectoryFailure() throws IOException {
+    @Test
+    void testExceptionOnCreateStorageDirectoryFailure() {
         Configuration config = new Configuration();
         config.setString(
-                BlobServerOptions.STORAGE_DIRECTORY,
-                new File(blobUtilsTestDirectory, CANNOT_CREATE_THIS).getAbsolutePath());
-        // Should throw an Exception
-        BlobUtils.createBlobStorageDirectory(config, null);
+                BlobServerOptions.STORAGE_DIRECTORY, getStorageLocationFile().getAbsolutePath());
+
+        assertThatThrownBy(() -> BlobUtils.createBlobStorageDirectory(config, null))
+                .isInstanceOf(IOException.class);
+    }
+
+    @Test
+    void testExceptionOnCreateCacheDirectoryFailureNoJob() {
+        assertThatThrownBy(
+                        () ->
+                                BlobUtils.getStorageLocation(
+                                        getStorageLocationFile(), null, new TransientBlobKey()))
+                .isInstanceOf(IOException.class);
     }
 
-    @Test(expected = IOException.class)
-    public void testExceptionOnCreateCacheDirectoryFailureNoJob() throws IOException {
-        // Should throw an Exception
-        BlobUtils.getStorageLocation(
-                new File(blobUtilsTestDirectory, CANNOT_CREATE_THIS), null, new TransientBlobKey());
+    @Test
+    void testExceptionOnCreateCacheDirectoryFailureForJobTransient() {
+        assertThatThrownBy(
+                        () ->
+                                BlobUtils.getStorageLocation(
+                                        getStorageLocationFile(),
+                                        new JobID(),
+                                        new TransientBlobKey()))
+                .isInstanceOf(IOException.class);
     }
 
-    @Test(expected = IOException.class)
-    public void testExceptionOnCreateCacheDirectoryFailureForJobTransient() throws IOException {
-        // Should throw an Exception
-        BlobUtils.getStorageLocation(
-                new File(blobUtilsTestDirectory, CANNOT_CREATE_THIS),
-                new JobID(),
-                new TransientBlobKey());
+    @Test
+    void testExceptionOnCreateCacheDirectoryFailureForJobPermanent() {
+        assertThatThrownBy(
+                        () ->
+                                BlobUtils.getStorageLocation(
+                                        getStorageLocationFile(),
+                                        new JobID(),
+                                        new PermanentBlobKey()))
+                .isInstanceOf(IOException.class);
     }
 
-    @Test(expected = IOException.class)
-    public void testExceptionOnCreateCacheDirectoryFailureForJobPermanent() throws IOException {
-        // Should throw an Exception
-        BlobUtils.getStorageLocation(
-                new File(blobUtilsTestDirectory, CANNOT_CREATE_THIS),
-                new JobID(),
-                new PermanentBlobKey());
+    private File getStorageLocationFile() {
+        return tempDir.resolve(CANNOT_CREATE_THIS).toFile();
     }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java
index 5daad8a9cf1..3b331d363a9 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java
@@ -23,19 +23,21 @@ import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.CoreOptions;
 import org.apache.flink.core.fs.local.LocalFileSystem;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 import org.apache.flink.util.FileUtils;
 import org.apache.flink.util.Reference;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.List;
 import java.util.UUID;
 import java.util.stream.Collectors;
@@ -44,20 +46,22 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for {@link BlobUtils}. */
-public class BlobUtilsTest extends TestLogger {
+class BlobUtilsTest {
 
-    @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();
+    private static final Logger LOG = LoggerFactory.getLogger(BlobUtilsTest.class);
+
+    @TempDir private Path tempDir;
 
     /**
      * Tests {@link BlobUtils#createBlobStorageDirectory} using {@link
      * BlobServerOptions#STORAGE_DIRECTORY} per default.
      */
     @Test
-    public void testDefaultBlobStorageDirectory() throws IOException {
+    void testDefaultBlobStorageDirectory() throws IOException {
         Configuration config = new Configuration();
-        String blobStorageDir = temporaryFolder.newFolder().getAbsolutePath();
+        String blobStorageDir = TempDirUtils.newFolder(tempDir).getAbsolutePath();
         config.setString(BlobServerOptions.STORAGE_DIRECTORY, blobStorageDir);
-        config.setString(CoreOptions.TMP_DIRS, temporaryFolder.newFolder().getAbsolutePath());
+        config.setString(CoreOptions.TMP_DIRS, TempDirUtils.newFolder(tempDir).getAbsolutePath());
 
         File dir = BlobUtils.createBlobStorageDirectory(config, null).deref();
         assertThat(dir.getAbsolutePath()).startsWith(blobStorageDir);
@@ -65,9 +69,9 @@ public class BlobUtilsTest extends TestLogger {
 
     /** Tests {@link BlobUtils#createBlobStorageDirectory}'s fallback to the fall back directory. */
     @Test
-    public void testTaskManagerFallbackBlobStorageDirectory1() throws IOException {
+    void testTaskManagerFallbackBlobStorageDirectory1() throws IOException {
         Configuration config = new Configuration();
-        final File fallbackDirectory = new File(temporaryFolder.newFolder(), "foobar");
+        final File fallbackDirectory = TempDirUtils.newFile(tempDir, "foobar");
 
         File dir =
                 BlobUtils.createBlobStorageDirectory(config, Reference.borrowed(fallbackDirectory))
@@ -75,34 +79,34 @@ public class BlobUtilsTest extends TestLogger {
         assertThat(dir).isEqualTo(fallbackDirectory);
     }
 
-    @Test(expected = IOException.class)
-    public void testBlobUtilsFailIfNoStorageDirectoryIsSpecified() throws IOException {
-        BlobUtils.createBlobStorageDirectory(new Configuration(), null);
+    @Test
+    void testBlobUtilsFailIfNoStorageDirectoryIsSpecified() {
+        assertThatThrownBy(() -> BlobUtils.createBlobStorageDirectory(new Configuration(), null))
+                .isInstanceOf(IOException.class);
     }
 
     @Test
-    public void testCheckAndDeleteCorruptedBlobsDeletesCorruptedBlobs() throws IOException {
-        final File storageDir = temporaryFolder.newFolder();
+    void testCheckAndDeleteCorruptedBlobsDeletesCorruptedBlobs() throws IOException {
         final JobID jobId = new JobID();
 
         final byte[] validContent = "valid".getBytes(StandardCharsets.UTF_8);
         final BlobKey validPermanentBlobKey =
-                TestingBlobUtils.writePermanentBlob(storageDir.toPath(), jobId, validContent);
+                TestingBlobUtils.writePermanentBlob(tempDir, jobId, validContent);
         final BlobKey validTransientBlobKey =
-                TestingBlobUtils.writeTransientBlob(storageDir.toPath(), jobId, validContent);
+                TestingBlobUtils.writeTransientBlob(tempDir, jobId, validContent);
 
         final PermanentBlobKey corruptedBlobKey =
-                TestingBlobUtils.writePermanentBlob(storageDir.toPath(), jobId, validContent);
+                TestingBlobUtils.writePermanentBlob(tempDir, jobId, validContent);
         FileUtils.writeFileUtf8(
                 new File(
                         BlobUtils.getStorageLocationPath(
-                                storageDir.getAbsolutePath(), jobId, corruptedBlobKey)),
+                                tempDir.toString(), jobId, corruptedBlobKey)),
                 "corrupted");
 
-        BlobUtils.checkAndDeleteCorruptedBlobs(storageDir.toPath(), log);
+        BlobUtils.checkAndDeleteCorruptedBlobs(tempDir, LOG);
 
         final List<BlobKey> blobKeys =
-                BlobUtils.listBlobsInDirectory(storageDir.toPath()).stream()
+                BlobUtils.listBlobsInDirectory(tempDir).stream()
                         .map(BlobUtils.Blob::getBlobKey)
                         .collect(Collectors.toList());
         assertThat(blobKeys)
@@ -110,13 +114,13 @@ public class BlobUtilsTest extends TestLogger {
     }
 
     @Test
-    public void testMoveTempFileToStoreSucceeds() throws IOException {
+    void testMoveTempFileToStoreSucceeds() throws IOException {
         final FileSystemBlobStore blobStore =
                 new FileSystemBlobStore(
-                        new LocalFileSystem(), temporaryFolder.newFolder().toString());
+                        new LocalFileSystem(), TempDirUtils.newFolder(tempDir).toString());
         final JobID jobId = new JobID();
-        final File storageFile = new File(temporaryFolder.getRoot(), UUID.randomUUID().toString());
-        final File incomingFile = temporaryFolder.newFile();
+        final File storageFile = tempDir.resolve(UUID.randomUUID().toString()).toFile();
+        final File incomingFile = TempDirUtils.newFile(tempDir);
         final byte[] fileContent = {1, 2, 3, 4};
         final BlobKey blobKey =
                 BlobKey.createKey(
@@ -124,27 +128,26 @@ public class BlobUtilsTest extends TestLogger {
                         BlobUtils.createMessageDigest().digest(fileContent));
         Files.write(incomingFile.toPath(), fileContent);
 
-        BlobUtils.moveTempFileToStore(incomingFile, jobId, blobKey, storageFile, log, blobStore);
+        BlobUtils.moveTempFileToStore(incomingFile, jobId, blobKey, storageFile, LOG, blobStore);
 
         assertThat(incomingFile).doesNotExist();
         assertThat(storageFile).hasBinaryContent(fileContent);
 
-        final File blobStoreFile =
-                new File(temporaryFolder.getRoot(), UUID.randomUUID().toString());
+        final File blobStoreFile = tempDir.resolve(UUID.randomUUID().toString()).toFile();
         assertThat(blobStore.get(jobId, blobKey, blobStoreFile)).isTrue();
         assertThat(blobStoreFile).hasBinaryContent(fileContent);
     }
 
     @Test
-    public void testCleanupIfMoveTempFileToStoreFails() throws IOException {
-        final File storageFile = new File(temporaryFolder.getRoot(), UUID.randomUUID().toString());
+    void testCleanupIfMoveTempFileToStoreFails() throws IOException {
+        final File storageFile = tempDir.resolve(UUID.randomUUID().toString()).toFile();
 
-        final File incomingFile = temporaryFolder.newFile();
+        final File incomingFile = TempDirUtils.newFile(tempDir);
         Files.write(incomingFile.toPath(), new byte[] {1, 2, 3, 4});
 
         final FileSystemBlobStore blobStore =
                 new FileSystemBlobStore(
-                        new LocalFileSystem(), temporaryFolder.newFolder().getAbsolutePath());
+                        new LocalFileSystem(), TempDirUtils.newFolder(tempDir).toString());
 
         final JobID jobId = new JobID();
         final BlobKey blobKey = BlobKey.createKey(BlobKey.BlobType.PERMANENT_BLOB);
@@ -155,7 +158,7 @@ public class BlobUtilsTest extends TestLogger {
                                         jobId,
                                         blobKey,
                                         storageFile,
-                                        log,
+                                        LOG,
                                         blobStore,
                                         (source, target) -> {
                                             throw new IOException("Test Failure");
@@ -167,9 +170,7 @@ public class BlobUtilsTest extends TestLogger {
                                 blobStore.get(
                                         jobId,
                                         blobKey,
-                                        new File(
-                                                temporaryFolder.getRoot(),
-                                                UUID.randomUUID().toString())))
+                                        tempDir.resolve(UUID.randomUUID().toString()).toFile()))
                 .isInstanceOf(FileNotFoundException.class);
         assertThat(incomingFile).doesNotExist();
         assertThat(storageFile).doesNotExist();
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/FileSystemBlobStoreTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/FileSystemBlobStoreTest.java
index c73c403712a..b4be78e699c 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/FileSystemBlobStoreTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/FileSystemBlobStoreTest.java
@@ -24,19 +24,16 @@ import org.apache.flink.core.fs.local.LocalDataOutputStream;
 import org.apache.flink.runtime.state.filesystem.TestFs;
 import org.apache.flink.testutils.TestFileSystem;
 import org.apache.flink.util.Preconditions;
-import org.apache.flink.util.TestLoggerExtension;
 import org.apache.flink.util.function.FunctionWithException;
 
 import org.apache.commons.io.FileUtils;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.io.TempDir;
 
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -51,25 +48,24 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for the {@link FileSystemBlobStore}. */
-@ExtendWith(TestLoggerExtension.class)
 class FileSystemBlobStoreTest {
 
     private FileSystemBlobStore testInstance;
     private Path storagePath;
 
     @BeforeEach
-    public void createTestInstance(@TempDir Path storagePath) throws IOException {
+    void createTestInstance(@TempDir Path storagePath) throws IOException {
         this.testInstance = new FileSystemBlobStore(new TestFileSystem(), storagePath.toString());
         this.storagePath = storagePath;
     }
 
     @AfterEach
-    public void finalizeTestInstance() throws IOException {
+    void finalizeTestInstance() throws IOException {
         testInstance.close();
     }
 
     @Test
-    public void testSuccessfulPut() throws IOException {
+    void testSuccessfulPut() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("put");
 
         final JobID jobId = new JobID();
@@ -86,7 +82,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testMissingFilePut() throws IOException {
+    void testMissingFilePut() {
         assertThatThrownBy(
                         () ->
                                 testInstance.put(
@@ -97,7 +93,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testSuccessfulGet() throws IOException {
+    void testSuccessfulGet() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("get");
         final JobID jobId = new JobID();
         final BlobKey blobKey = createPermanentBlobKeyFromFile(temporaryFile);
@@ -113,7 +109,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testGetWithWrongJobId() throws IOException {
+    void testGetWithWrongJobId() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("get");
         final BlobKey blobKey = createPermanentBlobKeyFromFile(temporaryFile);
 
@@ -132,7 +128,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testGetWithWrongBlobKey() throws IOException {
+    void testGetWithWrongBlobKey() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("get");
 
         final JobID jobId = new JobID();
@@ -152,7 +148,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testSuccessfulDeleteOnlyBlob() throws IOException {
+    void testSuccessfulDeleteOnlyBlob() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("delete");
         final JobID jobId = new JobID();
         final BlobKey blobKey = createPermanentBlobKeyFromFile(temporaryFile);
@@ -169,7 +165,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testSuccessfulDeleteBlob() throws IOException {
+    void testSuccessfulDeleteBlob() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("delete");
         final JobID jobId = new JobID();
         final BlobKey blobKey = createPermanentBlobKeyFromFile(temporaryFile);
@@ -190,12 +186,12 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testDeleteWithNotExistingJobId() {
+    void testDeleteWithNotExistingJobId() {
         assertThat(testInstance.delete(new JobID(), new PermanentBlobKey())).isTrue();
     }
 
     @Test
-    public void testDeleteWithNotExistingBlobKey() throws IOException {
+    void testDeleteWithNotExistingBlobKey() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("delete");
         final JobID jobId = new JobID();
         final BlobKey blobKey = createPermanentBlobKeyFromFile(temporaryFile);
@@ -206,7 +202,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testDeleteAll() throws IOException {
+    void testDeleteAll() throws IOException {
         final Path temporaryFile = createTemporaryFileWithContent("delete");
         final JobID jobId = new JobID();
 
@@ -223,7 +219,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void testDeleteAllWithNotExistingJobId() {
+    void testDeleteAllWithNotExistingJobId() {
         final JobID jobId = new JobID();
         assertThat(testInstance.deleteAll(jobId)).isTrue();
         assertThat(getPath(jobId)).doesNotExist();
@@ -260,7 +256,7 @@ class FileSystemBlobStoreTest {
         Preconditions.checkArgument(Files.exists(path));
 
         MessageDigest md = BlobUtils.createMessageDigest();
-        try (InputStream is = new FileInputStream(path.toFile())) {
+        try (InputStream is = Files.newInputStream(path.toFile().toPath())) {
             final byte[] buf = new byte[1024];
             int bytesRead = is.read(buf);
             while (bytesRead >= 0) {
@@ -273,8 +269,7 @@ class FileSystemBlobStoreTest {
     }
 
     @Test
-    public void fileSystemBlobStoreCallsSyncOnPut(@TempDir Path storageDirectory)
-            throws IOException {
+    void fileSystemBlobStoreCallsSyncOnPut(@TempDir Path storageDirectory) throws IOException {
         final Path blobStoreDirectory = storageDirectory.resolve("blobStore");
 
         final AtomicReference<TestingLocalDataOutputStream> createdOutputStream =
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheSizeLimitTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheSizeLimitTest.java
index 03528e60b46..974d8122eb6 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheSizeLimitTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheSizeLimitTest.java
@@ -22,15 +22,15 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.concurrent.FutureUtils;
 
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import javax.annotation.Nullable;
 
 import java.io.File;
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
@@ -40,18 +40,14 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * Test for using {@link BlobCacheSizeTracker} to track the size of BLOBs in {@link
  * PermanentBlobCache}. When new BLOBs are intended to be stored and the size limit exceeds, {@link
  * BlobCacheSizeTracker} will provide excess BLOBs for {@link PermanentBlobCache} to delete.
  */
-public class PermanentBlobCacheSizeLimitTest {
+class PermanentBlobCacheSizeLimitTest {
 
     private static final Random RANDOM = new Random();
 
@@ -61,14 +57,13 @@ public class PermanentBlobCacheSizeLimitTest {
     private static final int MAX_NUM_OF_ACCEPTED_BLOBS = 2;
     private static final int TOTAL_NUM_OF_BLOBS = 3;
 
-    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
+    @TempDir Path tempDir;
 
     @Test
-    public void testTrackSizeLimitAndDeleteExcessSequentially() throws Exception {
+    void testTrackSizeLimitAndDeleteExcessSequentially() throws Exception {
         final Configuration config = new Configuration();
 
-        try (BlobServer server =
-                        new BlobServer(config, TEMPORARY_FOLDER.newFolder(), new VoidBlobStore());
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir, config);
                 BlobCacheService cache =
                         initBlobCacheServiceWithSizeLimit(
                                 config, new InetSocketAddress("localhost", server.getPort()))) {
@@ -86,13 +81,13 @@ public class PermanentBlobCacheSizeLimitTest {
 
                 // Retrieve the location of BLOBs from the blob cache
                 blobs[i].blobFile = getFile(cache, blobs[i].jobId, blobs[i].blobKey);
-                assertTrue(blobs[i].blobFile.exists());
+                assertThat(blobs[i].blobFile).exists();
             }
 
             // Since the size limit of the blob cache is the size of 2 BLOBs,
             // the first BLOB is removed and the second BLOB remains
-            assertFalse(blobs[0].blobFile.exists());
-            assertTrue(blobs[1].blobFile.exists());
+            assertThat(blobs[0].blobFile).doesNotExist();
+            assertThat(blobs[1].blobFile).exists();
 
             // Retrieve the second BLOB once again,
             // make the third BLOB to be the least recently used
@@ -103,20 +98,19 @@ public class PermanentBlobCacheSizeLimitTest {
             readFileAndVerifyContent(cache, blobs[0].jobId, blobs[0].blobKey, blobs[0].data);
             blobs[0].blobFile = getFile(cache, blobs[0].jobId, blobs[0].blobKey);
 
-            assertTrue(blobs[0].blobFile.exists());
-            assertTrue(blobs[1].blobFile.exists());
-            assertFalse(blobs[2].blobFile.exists());
+            assertThat(blobs[0].blobFile).exists();
+            assertThat(blobs[1].blobFile).exists();
+            assertThat(blobs[2].blobFile).doesNotExist();
         }
     }
 
     @Test
-    public void testTrackSizeLimitAndDeleteExcessConcurrently() throws Exception {
+    void testTrackSizeLimitAndDeleteExcessConcurrently() throws Exception {
 
         final ExecutorService executor = Executors.newFixedThreadPool(TOTAL_NUM_OF_BLOBS);
         final Configuration config = new Configuration();
 
-        try (BlobServer server =
-                        new BlobServer(config, TEMPORARY_FOLDER.newFolder(), new VoidBlobStore());
+        try (BlobServer server = TestingBlobUtils.createServer(tempDir, config);
                 BlobCacheService cache =
                         initBlobCacheServiceWithSizeLimit(
                                 config, new InetSocketAddress("localhost", server.getPort()))) {
@@ -171,8 +165,8 @@ public class PermanentBlobCacheSizeLimitTest {
                     nonExists++;
                 }
             }
-            assertEquals(MAX_NUM_OF_ACCEPTED_BLOBS, exists);
-            assertEquals(TOTAL_NUM_OF_BLOBS - MAX_NUM_OF_ACCEPTED_BLOBS, nonExists);
+            assertThat(exists).isEqualTo(MAX_NUM_OF_ACCEPTED_BLOBS);
+            assertThat(nonExists).isEqualTo(TOTAL_NUM_OF_BLOBS - MAX_NUM_OF_ACCEPTED_BLOBS);
 
         } finally {
             executor.shutdownNow();
@@ -196,51 +190,51 @@ public class PermanentBlobCacheSizeLimitTest {
         }
     }
 
-    private static BlobInfo[] putBlobsIntoBlobServer(BlobServer server) throws IOException {
-        // Initialize the information of BLOBs
-        BlobInfo[] blobs = new BlobInfo[TOTAL_NUM_OF_BLOBS];
-
-        // Put all the BLOBs into the blob server one by one
-        for (int i = 0; i < TOTAL_NUM_OF_BLOBS; i++) {
-            blobs[i] = new BlobInfo();
-
-            // Put the BLOB into the blob server
-            blobs[i].blobKey = put(server, blobs[i].jobId, blobs[i].data, BLOB_TYPE);
-            assertNotNull(blobs[i].blobKey);
-        }
-
-        return blobs;
-    }
-
-    private static BlobCacheService initBlobCacheServiceWithSizeLimit(
+    private BlobCacheService initBlobCacheServiceWithSizeLimit(
             Configuration config, @Nullable final InetSocketAddress serverAddress)
             throws IOException {
 
         final PermanentBlobCache permanentBlobCache =
                 new PermanentBlobCache(
                         config,
-                        TEMPORARY_FOLDER.newFolder(),
+                        tempDir.resolve("permanent_cache").toFile(),
                         new VoidBlobStore(),
                         serverAddress,
                         new BlobCacheSizeTracker(MAX_NUM_OF_ACCEPTED_BLOBS * BLOB_SIZE));
 
         final TransientBlobCache transientBlobCache =
-                new TransientBlobCache(config, TEMPORARY_FOLDER.newFolder(), serverAddress);
+                new TransientBlobCache(
+                        config, tempDir.resolve("transient_cache").toFile(), serverAddress);
 
         return new BlobCacheService(permanentBlobCache, transientBlobCache);
     }
 
+    private static BlobInfo[] putBlobsIntoBlobServer(BlobServer server) throws IOException {
+        // Initialize the information of BLOBs
+        BlobInfo[] blobs = new BlobInfo[TOTAL_NUM_OF_BLOBS];
+
+        // Put all the BLOBs into the blob server one by one
+        for (int i = 0; i < TOTAL_NUM_OF_BLOBS; i++) {
+            blobs[i] = new BlobInfo();
+
+            // Put the BLOB into the blob server
+            blobs[i].blobKey = put(server, blobs[i].jobId, blobs[i].data, BLOB_TYPE);
+            assertThat(blobs[i].blobKey).isNotNull();
+        }
+
+        return blobs;
+    }
+
     private static void readFileAndVerifyContent(
             BlobService blobService, JobID jobId, BlobKey blobKey, byte[] expected)
             throws IOException {
 
-        assertNotNull(jobId);
-        assertNotNull(blobKey);
-        assertTrue(blobKey instanceof PermanentBlobKey);
+        assertThat(jobId).isNotNull();
+        assertThat(blobKey).isNotNull().isInstanceOf(PermanentBlobKey.class);
 
         byte[] target =
                 blobService.getPermanentBlobService().readFile(jobId, (PermanentBlobKey) blobKey);
-        assertArrayEquals(expected, target);
+        assertThat(target).isEqualTo(expected);
     }
 
     private static File getFile(BlobCacheService blobCacheService, JobID jobId, BlobKey blobKey)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheTest.java
index 99599af225d..da7ced8b352 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/PermanentBlobCacheTest.java
@@ -22,11 +22,9 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.testutils.CommonTestUtils;
-import org.apache.flink.util.TestLoggerExtension;
 
 import org.apache.commons.io.FileUtils;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.io.TempDir;
 
 import java.io.File;
@@ -39,11 +37,10 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Test for the {@link PermanentBlobCache}. */
-@ExtendWith(TestLoggerExtension.class)
-public class PermanentBlobCacheTest {
+class PermanentBlobCacheTest {
 
     @Test
-    public void permanentBlobCacheCanServeFilesFromPrepopulatedStorageDirectory(
+    void permanentBlobCacheCanServeFilesFromPrepopulatedStorageDirectory(
             @TempDir Path storageDirectory) throws IOException {
 
         final JobID jobId = new JobID();
@@ -64,7 +61,7 @@ public class PermanentBlobCacheTest {
     }
 
     @Test
-    public void permanentBlobCacheChecksForCorruptedBlobsAtStart(@TempDir Path storageDirectory)
+    void permanentBlobCacheChecksForCorruptedBlobsAtStart(@TempDir Path storageDirectory)
             throws IOException {
         final JobID jobId = new JobID();
         final PermanentBlobKey blobKey =
@@ -90,8 +87,7 @@ public class PermanentBlobCacheTest {
     }
 
     @Test
-    public void permanentBlobCacheTimesOutRecoveredBlobs(@TempDir Path storageDirectory)
-            throws Exception {
+    void permanentBlobCacheTimesOutRecoveredBlobs(@TempDir Path storageDirectory) throws Exception {
         final JobID jobId = new JobID();
         final PermanentBlobKey permanentBlobKey =
                 TestingBlobUtils.writePermanentBlob(
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobHelpers.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobHelpers.java
new file mode 100644
index 00000000000..2f56a3b8148
--- /dev/null
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobHelpers.java
@@ -0,0 +1,439 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.blob;
+
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.HighAvailabilityOptions;
+import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.core.testutils.FlinkAssertions;
+import org.apache.flink.util.concurrent.Executors;
+
+import org.apache.commons.io.FileUtils;
+
+import javax.annotation.Nullable;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Random;
+
+import static org.apache.flink.runtime.blob.BlobKey.BlobType.PERMANENT_BLOB;
+import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB;
+import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashDifferent;
+import static org.apache.flink.runtime.blob.BlobKeyTest.verifyKeyDifferentHashEquals;
+import static org.apache.flink.runtime.blob.BlobServerGetTest.get;
+import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted;
+import static org.apache.flink.runtime.blob.BlobServerPutTest.put;
+import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+
+/** Helper functions for testing and verifying BLOB related logic. */
+public final class TestingBlobHelpers {
+
+    private TestingBlobHelpers() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Checks how many of the files given by blob keys are accessible.
+     *
+     * @param jobId ID of a job
+     * @param keys blob keys to check
+     * @param blobService BLOB store to use
+     * @param doThrow whether exceptions should be ignored (<tt>false</tt>), or thrown
+     *     (<tt>true</tt>)
+     * @return number of files existing at {@link BlobServer#getStorageLocation(JobID, BlobKey)} and
+     *     {@link PermanentBlobCache#getStorageLocation(JobID, BlobKey)}, respectively
+     */
+    public static <T> int checkFilesExist(
+            JobID jobId, Collection<? extends BlobKey> keys, T blobService, boolean doThrow)
+            throws IOException {
+
+        int numFiles = 0;
+
+        for (BlobKey key : keys) {
+            final File storageDir;
+            if (blobService instanceof BlobServer) {
+                BlobServer server = (BlobServer) blobService;
+                storageDir = server.getStorageDir();
+            } else if (blobService instanceof PermanentBlobCache) {
+                PermanentBlobCache cache = (PermanentBlobCache) blobService;
+                storageDir = cache.getStorageDir();
+            } else if (blobService instanceof TransientBlobCache) {
+                TransientBlobCache cache = (TransientBlobCache) blobService;
+                storageDir = cache.getStorageDir();
+            } else {
+                throw new UnsupportedOperationException(
+                        "unsupported BLOB service class: "
+                                + blobService.getClass().getCanonicalName());
+            }
+
+            final File blobFile =
+                    new File(
+                            BlobUtils.getStorageLocationPath(
+                                    storageDir.getAbsolutePath(), jobId, key));
+            if (blobFile.exists()) {
+                ++numFiles;
+            } else if (doThrow) {
+                throw new IOException("File " + blobFile + " does not exist.");
+            }
+        }
+
+        return numFiles;
+    }
+
+    /**
+     * Checks how many of the files given by blob keys are accessible.
+     *
+     * @param expectedCount number of expected files in the blob service for the given job
+     * @param jobId ID of a job
+     * @param blobService BLOB store to use
+     */
+    public static void checkFileCountForJob(
+            int expectedCount, JobID jobId, PermanentBlobService blobService) throws IOException {
+
+        final File jobDir;
+        if (blobService instanceof BlobServer) {
+            BlobServer server = (BlobServer) blobService;
+            jobDir = server.getStorageLocation(jobId, new PermanentBlobKey()).getParentFile();
+        } else {
+            PermanentBlobCache cache = (PermanentBlobCache) blobService;
+            jobDir = cache.getStorageLocation(jobId, new PermanentBlobKey()).getParentFile();
+        }
+        File[] blobsForJob = jobDir.listFiles();
+        if (blobsForJob == null) {
+            if (expectedCount != 0) {
+                throw new IOException("File " + jobDir + " does not exist.");
+            }
+        } else {
+            assertThat(blobsForJob.length)
+                    .as("Too many/few files in job dir: " + Arrays.asList(blobsForJob))
+                    .isEqualTo(expectedCount);
+        }
+    }
+
+    /**
+     * Checks the GET operation fails when the downloaded file (from HA store) is corrupt, i.e. its
+     * content's hash does not match the {@link BlobKey}'s hash.
+     *
+     * @param config blob server configuration (including HA settings like {@link
+     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
+     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
+     * @param blobStore shared HA blob store to use
+     */
+    public static void testGetFailsFromCorruptFile(
+            Configuration config, BlobStore blobStore, File blobStorage) throws IOException {
+
+        Random rnd = new Random();
+        JobID jobId = new JobID();
+
+        try (BlobServer server = new BlobServer(config, blobStorage, blobStore)) {
+
+            server.start();
+
+            byte[] data = new byte[2000000];
+            rnd.nextBytes(data);
+
+            // put content addressable (like libraries)
+            BlobKey key = put(server, jobId, data, PERMANENT_BLOB);
+            assertThat(key).isNotNull();
+
+            // delete local file to make sure that the GET requests downloads from HA
+            File blobFile = server.getStorageLocation(jobId, key);
+            assertThat(blobFile.delete()).isTrue();
+
+            // change HA store file contents to make sure that GET requests fail
+            byte[] data2 = Arrays.copyOf(data, data.length);
+            data2[0] ^= 1;
+            File tmpFile = Files.createTempFile("blob", ".jar").toFile();
+            try {
+                FileUtils.writeByteArrayToFile(tmpFile, data2);
+                blobStore.put(tmpFile, jobId, key);
+            } finally {
+                //noinspection ResultOfMethodCallIgnored
+                tmpFile.delete();
+            }
+
+            assertThatThrownBy(() -> get(server, jobId, key))
+                    .satisfies(
+                            FlinkAssertions.anyCauseMatches(IOException.class, "data corruption"));
+        }
+    }
+
+    /**
+     * Checks the GET operation fails when the downloaded file (from HA store) is corrupt, i.e. its
+     * content's hash does not match the {@link BlobKey}'s hash, using a permanent BLOB.
+     *
+     * @param jobId job ID
+     * @param config blob server configuration (including HA settings like {@link
+     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
+     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
+     * @param blobStore shared HA blob store to use
+     */
+    public static void testGetFailsFromCorruptFile(
+            JobID jobId, Configuration config, BlobStore blobStore, File blobStorage)
+            throws IOException {
+
+        testGetFailsFromCorruptFile(jobId, PERMANENT_BLOB, true, config, blobStore, blobStorage);
+    }
+
+    /**
+     * Checks the GET operation fails when the downloaded file (from {@link BlobServer} or HA store)
+     * is corrupt, i.e. its content's hash does not match the {@link BlobKey}'s hash.
+     *
+     * @param jobId job ID or <tt>null</tt> if job-unrelated
+     * @param blobType whether the BLOB should become permanent or transient
+     * @param corruptOnHAStore whether the file should be corrupt in the HA store (<tt>true</tt>,
+     *     required <tt>highAvailability</tt> to be set) or on the {@link BlobServer}'s local store
+     *     (<tt>false</tt>)
+     * @param config blob server configuration (including HA settings like {@link
+     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
+     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
+     * @param blobStore shared HA blob store to use
+     */
+    static void testGetFailsFromCorruptFile(
+            @Nullable JobID jobId,
+            BlobKey.BlobType blobType,
+            boolean corruptOnHAStore,
+            Configuration config,
+            BlobStore blobStore,
+            File blobStorage)
+            throws IOException {
+
+        assertThat(!corruptOnHAStore || blobType == PERMANENT_BLOB)
+                .as("Check HA setup for corrupt HA file")
+                .isTrue();
+
+        Random rnd = new Random();
+
+        try (BlobServer server =
+                        new BlobServer(config, new File(blobStorage, "server"), blobStore);
+                BlobCacheService cache =
+                        new BlobCacheService(
+                                config,
+                                new File(blobStorage, "cache"),
+                                corruptOnHAStore ? blobStore : new VoidBlobStore(),
+                                new InetSocketAddress("localhost", server.getPort()))) {
+
+            server.start();
+
+            byte[] data = new byte[2000000];
+            rnd.nextBytes(data);
+
+            // put content addressable (like libraries)
+            BlobKey key = put(server, jobId, data, blobType);
+            assertThat(key).isNotNull();
+
+            // change server/HA store file contents to make sure that GET requests fail
+            byte[] data2 = Arrays.copyOf(data, data.length);
+            data2[0] ^= 1;
+            if (corruptOnHAStore) {
+                File tmpFile = Files.createTempFile("blob", ".jar").toFile();
+                try {
+                    FileUtils.writeByteArrayToFile(tmpFile, data2);
+                    blobStore.put(tmpFile, jobId, key);
+                } finally {
+                    //noinspection ResultOfMethodCallIgnored
+                    tmpFile.delete();
+                }
+
+                // delete local (correct) file on server to make sure that the GET request does not
+                // fall back to downloading the file from the BlobServer's local store
+                File blobFile = server.getStorageLocation(jobId, key);
+                assertThat(blobFile.delete()).isTrue();
+            } else {
+                File blobFile = server.getStorageLocation(jobId, key);
+                assertThat(blobFile).exists();
+                FileUtils.writeByteArrayToFile(blobFile, data2);
+            }
+
+            // issue a GET request that fails
+            assertThatThrownBy(() -> get(cache, jobId, key))
+                    .satisfies(
+                            FlinkAssertions.anyCauseMatches(IOException.class, "data corruption"));
+        }
+    }
+
+    /**
+     * Helper to test that the {@link BlobServer} recovery from its HA store works.
+     *
+     * <p>Uploads two BLOBs to one {@link BlobServer} and expects a second one to be able to
+     * retrieve them via a shared HA store upon request of a {@link BlobCacheService}.
+     *
+     * @param config blob server configuration (including HA settings like {@link
+     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
+     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
+     * @param blobStore shared HA blob store to use
+     * @throws IOException in case of failures
+     */
+    public static void testBlobServerRecovery(
+            final Configuration config, final BlobStore blobStore, final File blobStorage)
+            throws Exception {
+        final String clusterId = config.getString(HighAvailabilityOptions.HA_CLUSTER_ID);
+        String storagePath =
+                config.getString(HighAvailabilityOptions.HA_STORAGE_PATH) + "/" + clusterId;
+        Random rand = new Random();
+
+        try (BlobServer server0 =
+                        new BlobServer(config, new File(blobStorage, "server0"), blobStore);
+                BlobServer server1 =
+                        new BlobServer(config, new File(blobStorage, "server1"), blobStore);
+                // use VoidBlobStore as the HA store to force download from server[1]'s HA store
+                BlobCacheService cache1 =
+                        new BlobCacheService(
+                                config,
+                                new File(blobStorage, "cache1"),
+                                new VoidBlobStore(),
+                                new InetSocketAddress("localhost", server1.getPort()))) {
+
+            server0.start();
+            server1.start();
+
+            // Random data
+            byte[] expected = new byte[1024];
+            rand.nextBytes(expected);
+            byte[] expected2 = Arrays.copyOfRange(expected, 32, 288);
+
+            BlobKey[] keys = new BlobKey[2];
+            BlobKey nonHAKey;
+
+            // Put job-related HA data
+            JobID[] jobId = new JobID[] {new JobID(), new JobID()};
+            keys[0] = put(server0, jobId[0], expected, PERMANENT_BLOB); // Request 1
+            keys[1] = put(server0, jobId[1], expected2, PERMANENT_BLOB); // Request 2
+
+            // put non-HA data
+            nonHAKey = put(server0, jobId[0], expected2, TRANSIENT_BLOB);
+            verifyKeyDifferentHashEquals(keys[1], nonHAKey);
+
+            // check that the storage directory exists
+            final Path blobServerPath = new Path(storagePath, "blob");
+            FileSystem fs = blobServerPath.getFileSystem();
+            assertThat(fs.exists(blobServerPath)).isTrue();
+
+            // Verify HA requests from cache1 (connected to server1) with no immediate access to the
+            // file
+            verifyContents(cache1, jobId[0], keys[0], expected);
+            verifyContents(cache1, jobId[1], keys[1], expected2);
+
+            // Verify non-HA file is not accessible from server1
+            verifyDeleted(cache1, jobId[0], nonHAKey);
+
+            // Remove again
+            server1.globalCleanupAsync(jobId[0], Executors.directExecutor()).join();
+            server1.globalCleanupAsync(jobId[1], Executors.directExecutor()).join();
+
+            // Verify everything is clean
+            assertThat(fs.exists(new Path(storagePath))).isTrue();
+            if (fs.exists(blobServerPath)) {
+                final org.apache.flink.core.fs.FileStatus[] recoveryFiles =
+                        fs.listStatus(blobServerPath);
+                ArrayList<String> filenames = new ArrayList<>(recoveryFiles.length);
+                for (org.apache.flink.core.fs.FileStatus file : recoveryFiles) {
+                    filenames.add(file.toString());
+                }
+                fail("Unclean state backend: %s", filenames);
+            }
+        }
+    }
+
+    /**
+     * Helper to test that the {@link BlobServer} recovery from its HA store works.
+     *
+     * <p>Uploads two BLOBs to one {@link BlobServer} via a {@link BlobCacheService} and expects a
+     * second {@link BlobCacheService} to be able to retrieve them from a second {@link BlobServer}
+     * that is configured with the same HA store.
+     *
+     * @param config blob server configuration (including HA settings like {@link
+     *     HighAvailabilityOptions#HA_STORAGE_PATH} and {@link
+     *     HighAvailabilityOptions#HA_CLUSTER_ID}) used to set up <tt>blobStore</tt>
+     * @param blobStore shared HA blob store to use
+     * @throws IOException in case of failures
+     */
+    public static void testBlobCacheRecovery(
+            final Configuration config, final BlobStore blobStore, final File blobStorage)
+            throws IOException {
+
+        final String clusterId = config.getString(HighAvailabilityOptions.HA_CLUSTER_ID);
+        String storagePath =
+                config.getString(HighAvailabilityOptions.HA_STORAGE_PATH) + "/" + clusterId;
+        Random rand = new Random();
+
+        try (BlobServer server0 =
+                        new BlobServer(config, new File(blobStorage, "server0"), blobStore);
+                BlobServer server1 =
+                        new BlobServer(config, new File(blobStorage, "server1"), blobStore);
+                // use VoidBlobStore as the HA store to force download from each server's HA store
+                BlobCacheService cache0 =
+                        new BlobCacheService(
+                                config,
+                                new File(blobStorage, "cache0"),
+                                new VoidBlobStore(),
+                                new InetSocketAddress("localhost", server0.getPort()));
+                BlobCacheService cache1 =
+                        new BlobCacheService(
+                                config,
+                                new File(blobStorage, "cache1"),
+                                new VoidBlobStore(),
+                                new InetSocketAddress("localhost", server1.getPort()))) {
+
+            server0.start();
+            server1.start();
+
+            // Random data
+            byte[] expected = new byte[1024];
+            rand.nextBytes(expected);
+            byte[] expected2 = Arrays.copyOfRange(expected, 32, 288);
+
+            BlobKey[] keys = new BlobKey[2];
+            BlobKey nonHAKey;
+
+            // Put job-related HA data
+            JobID[] jobId = new JobID[] {new JobID(), new JobID()};
+            keys[0] = put(cache0, jobId[0], expected, PERMANENT_BLOB); // Request 1
+            keys[1] = put(cache0, jobId[1], expected2, PERMANENT_BLOB); // Request 2
+
+            // put non-HA data
+            nonHAKey = put(cache0, jobId[0], expected2, TRANSIENT_BLOB);
+            verifyKeyDifferentHashDifferent(keys[0], nonHAKey);
+            verifyKeyDifferentHashEquals(keys[1], nonHAKey);
+
+            // check that the storage directory exists
+            final Path blobServerPath = new Path(storagePath, "blob");
+            FileSystem fs = blobServerPath.getFileSystem();
+            assertThat(fs.exists(blobServerPath)).isTrue();
+
+            // Verify HA requests from cache1 (connected to server1) with no immediate access to the
+            // file
+            verifyContents(cache1, jobId[0], keys[0], expected);
+            verifyContents(cache1, jobId[1], keys[1], expected2);
+
+            // Verify non-HA file is not accessible from server1
+            verifyDeleted(cache1, jobId[0], nonHAKey);
+        }
+    }
+}
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobUtils.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobUtils.java
index 4a58f03a6f8..3480dc8df39 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobUtils.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobUtils.java
@@ -19,6 +19,8 @@
 package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.configuration.Configuration;
 
 import org.apache.commons.io.FileUtils;
 
@@ -26,10 +28,11 @@ import javax.annotation.Nonnull;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.nio.file.Path;
 
 /** Utility class for testing methods for blobs. */
-public class TestingBlobUtils {
+class TestingBlobUtils {
     private TestingBlobUtils() {
         throw new UnsupportedOperationException(
                 String.format("Cannot instantiate %s.", TestingBlobUtils.class.getSimpleName()));
@@ -65,4 +68,144 @@ public class TestingBlobUtils {
 
         return blobKey;
     }
+
+    @Nonnull
+    static BlobServer createServer(Path tempDir) throws IOException {
+        return createServer(tempDir, new Configuration(), new VoidBlobStore());
+    }
+
+    @Nonnull
+    static BlobServer createServer(Path tempDir, Configuration config) throws IOException {
+        return createServer(tempDir, config, new VoidBlobStore());
+    }
+
+    @Nonnull
+    static BlobServer createServer(Path tempDir, Configuration config, BlobStore serverStore)
+            throws IOException {
+        return new BlobServer(config, getServerDir(tempDir), serverStore);
+    }
+
+    @Nonnull
+    static PermanentBlobCache createPermanentCache(Path tempDir, BlobServer server)
+            throws IOException {
+        return createPermanentCache(tempDir, new Configuration(), getServerAddress(server));
+    }
+
+    @Nonnull
+    static PermanentBlobCache createPermanentCache(
+            Path tempDir, Configuration config, BlobServer server) throws IOException {
+        return createPermanentCache(tempDir, config, getServerAddress(server));
+    }
+
+    @Nonnull
+    static PermanentBlobCache createPermanentCache(
+            Path tempDir, Configuration config, BlobServer server, BlobCacheSizeTracker tracker)
+            throws IOException {
+        return createPermanentCache(tempDir, config, getServerAddress(server), tracker);
+    }
+
+    @Nonnull
+    static PermanentBlobCache createPermanentCache(
+            Path tempDir, Configuration config, InetSocketAddress serverAddress)
+            throws IOException {
+        return createPermanentCache(tempDir, config, serverAddress, null);
+    }
+
+    @Nonnull
+    static TransientBlobCache createTransientCache(Path tempDir, BlobServer server)
+            throws IOException {
+        return new TransientBlobCache(
+                new Configuration(), getCacheDir(tempDir), getServerAddress(server));
+    }
+
+    @Nonnull
+    static PermanentBlobCache createPermanentCache(
+            Path tempDir,
+            Configuration config,
+            InetSocketAddress serverAddress,
+            BlobCacheSizeTracker tracker)
+            throws IOException {
+        if (tracker == null) {
+            return new PermanentBlobCache(
+                    config, getCacheDir(tempDir), new VoidBlobStore(), serverAddress);
+        }
+
+        return new PermanentBlobCache(
+                config, getCacheDir(tempDir), new VoidBlobStore(), serverAddress, tracker);
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createServerAndCache(Path tempDir)
+            throws IOException {
+        return createServerAndCache(
+                tempDir, new Configuration(), new VoidBlobStore(), new VoidBlobStore());
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createServerAndCache(
+            Path tempDir, Configuration config) throws IOException {
+        return createServerAndCache(tempDir, config, new VoidBlobStore(), new VoidBlobStore());
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createServerAndCache(
+            Path tempDir, BlobStore serverStore, BlobStore cacheStore) throws IOException {
+        return createServerAndCache(tempDir, new Configuration(), serverStore, cacheStore);
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createServerAndCache(
+            Path tempDir, Configuration config, BlobStore serverStore, BlobStore cacheStore)
+            throws IOException {
+        return createServerAndCache(tempDir, config, config, serverStore, cacheStore);
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createServerAndCache(
+            Path tempDir,
+            Configuration serverConfig,
+            Configuration cacheConfig,
+            BlobStore serverStore,
+            BlobStore cacheStore)
+            throws IOException {
+        BlobServer server = createServer(tempDir, serverConfig, serverStore);
+        BlobCacheService cache =
+                new BlobCacheService(
+                        cacheConfig,
+                        getCacheDir(tempDir),
+                        cacheStore,
+                        new InetSocketAddress("localhost", server.getPort()));
+
+        return Tuple2.of(server, cache);
+    }
+
+    @Nonnull
+    static Tuple2<BlobServer, BlobCacheService> createFailingServerAndCache(
+            Path tempDir, BlobStore serverStore, int numAccept, int numFailures)
+            throws IOException {
+        Configuration config = new Configuration();
+        BlobServer server =
+                new TestingFailingBlobServer(
+                        config, getServerDir(tempDir), serverStore, numAccept, numFailures);
+        BlobCacheService cache =
+                new BlobCacheService(
+                        config,
+                        getCacheDir(tempDir),
+                        new VoidBlobStore(),
+                        new InetSocketAddress("localhost", server.getPort()));
+
+        return Tuple2.of(server, cache);
+    }
+
+    private static InetSocketAddress getServerAddress(BlobServer server) {
+        return new InetSocketAddress("localhost", server.getPort());
+    }
+
+    private static File getServerDir(Path tempDir) {
+        return tempDir.resolve("server").toFile();
+    }
+
+    private static File getCacheDir(Path tempDir) {
+        return tempDir.resolve("cache").toFile();
+    }
 }
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TransientBlobCacheTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TransientBlobCacheTest.java
index d29b31b6dc6..ca9e9381419 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TransientBlobCacheTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/TransientBlobCacheTest.java
@@ -22,11 +22,9 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.testutils.CommonTestUtils;
-import org.apache.flink.util.TestLoggerExtension;
 
 import org.apache.commons.io.FileUtils;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.io.TempDir;
 
 import java.io.File;
@@ -36,11 +34,10 @@ import java.nio.file.Path;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for the {@link TransientBlobCache}. */
-@ExtendWith(TestLoggerExtension.class)
-public class TransientBlobCacheTest {
+class TransientBlobCacheTest {
 
     @Test
-    public void transientBlobCacheCanServeFilesFromPrepopulatedStorageDirectory(
+    void transientBlobCacheCanServeFilesFromPrepopulatedStorageDirectory(
             @TempDir Path storageDirectory) throws IOException {
         final JobID jobId = new JobID();
 
@@ -55,7 +52,7 @@ public class TransientBlobCacheTest {
     }
 
     @Test
-    public void transientBlobCacheChecksForCorruptedBlobsAtStart(@TempDir Path storageDirectory)
+    void transientBlobCacheChecksForCorruptedBlobsAtStart(@TempDir Path storageDirectory)
             throws IOException {
         final JobID jobId = new JobID();
 
@@ -76,8 +73,7 @@ public class TransientBlobCacheTest {
     }
 
     @Test
-    public void transientBlobCacheTimesOutRecoveredBlobs(@TempDir Path storageDirectory)
-            throws Exception {
+    void transientBlobCacheTimesOutRecoveredBlobs(@TempDir Path storageDirectory) throws Exception {
         final JobID jobId = new JobID();
         final TransientBlobKey transientBlobKey =
                 TestingBlobUtils.writeTransientBlob(
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
index dda0e2a9580..c81d2446c4d 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
@@ -49,8 +49,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFileCountForJob;
-import static org.apache.flink.runtime.blob.BlobServerCleanupTest.checkFilesExist;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFileCountForJob;
+import static org.apache.flink.runtime.blob.TestingBlobHelpers.checkFilesExist;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.sameInstance;
 import static org.junit.Assert.assertEquals;