You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ex...@apache.org on 2022/11/28 20:47:39 UTC

[nifi] branch main updated (83feb0a02d -> e8d554d9b4)

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

exceptionfactory pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


    from 83feb0a02d NIFI-7190 CaptureChangeMySQL processor remove comments from normalized query
     new 31af82275e NIFI-10791 Added AWS SDK v2 support to AWSCredentialsProviderControllerService
     new e8d554d9b4 NIFI-10876 Converted some nifi-framework tests from JUnit 4 to JUnit 5

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../nifi-aws-abstract-processors/pom.xml           |   8 ++
 .../factory/CredentialPropertyDescriptors.java     |  29 ++++
 .../nifi-aws-bundle/nifi-aws-processors/pom.xml    |   4 +
 .../provider/PropertiesCredentialsProvider.java    |  63 +++++++++
 .../factory/CredentialsProviderFactory.java        |  21 +++
 .../provider/factory/CredentialsStrategy.java      |  20 ++-
 .../AbstractBooleanCredentialsStrategy.java        |  18 +--
 .../strategies/AbstractCredentialsStrategy.java    |  42 +++---
 .../AccessKeyPairCredentialsStrategy.java          |  28 ++--
 .../strategies/AnonymousCredentialsStrategy.java   |  22 +--
 .../strategies/AssumeRoleCredentialsStrategy.java  | 106 ++++++++++++---
 .../ExplicitDefaultCredentialsStrategy.java        |   9 +-
 .../strategies/FileCredentialsStrategy.java        |  22 ++-
 .../ImplicitDefaultCredentialsStrategy.java        |  15 ++-
 .../NamedProfileCredentialsStrategy.java           |  10 +-
 .../AWSCredentialsProviderControllerService.java   |  29 ++--
 .../provider/factory/MockAWSProcessor.java         |   4 +-
 .../factory/TestCredentialsProviderFactory.java    |  54 +++++++-
 ...WSCredentialsProviderControllerServiceTest.java |  26 ++++
 .../nifi-aws-bundle/nifi-aws-service-api/pom.xml   |   4 +
 ...ice.java => AwsCredentialsProviderService.java} |  23 ++--
 .../service/AWSCredentialsProviderService.java     |   9 +-
 .../nifi/authorization/AuthorizerFactoryTest.java  |  65 ++++-----
 .../nifi/web/api/dto/TestProcessGroupDTO.java      |   9 +-
 .../nifi/web/api/dto/TestProcessGroupEntity.java   |   9 +-
 .../web/api/dto/TestRemoteProcessGroupDTO.java     |  20 ++-
 .../nifi/web/api/dto/util/TestNumberUtil.java      |   7 +-
 .../html/ProcessorDocumentationWriterTest.java     |  20 +--
 .../FileAccessPolicyProviderTest.java              |  57 +++++---
 .../nifi/authorization/FileAuthorizerTest.java     |  73 ++++++----
 .../authorization/FileUserGroupProviderTest.java   |  43 +++---
 .../resource/DataAuthorizableTest.java             |  21 +--
 .../resource/OperationAuthorizableTest.java        |   6 +-
 .../resource/ProvenanceDataAuthorizableTest.java   |  22 +--
 .../jaxb/message/TestJaxbProtocolUtils.java        |   6 +-
 .../repository/TestRingBufferEventRepository.java  |  17 ++-
 .../repository/TestStandardFlowFileRecord.java     |   7 +-
 .../repository/TestStandardProvenanceReporter.java |   6 +-
 .../metrics/TestSecondPrecisionEventContainer.java |   8 +-
 ...StandardControllerServiceInvocationHandler.java |  18 +--
 ...StandardVersionedComponentSynchronizerTest.java |  23 ++--
 .../nifi/logging/TestStandardLogRepository.java    |   6 +-
 .../parameter/TestStandardParameterContext.java    | 150 ++++++++++-----------
 .../nifi/processor/TestStandardPropertyValue.java  |  12 +-
 .../processor/TestStandardValidationContext.java   |   7 +-
 .../NiFiRegistryExtensionBundleMetadataTest.java   |   6 +-
 .../flow/mapping/TestNiFiRegistryFlowMapper.java   |   8 +-
 .../org/apache/nifi/util/ReflectionUtilsTest.java  |  36 ++---
 .../nifi/util/TestFlowDifferenceFilters.java       |  24 ++--
 .../TestControllerServiceApiMatcher.java           |  10 +-
 .../apache/nifi/controller/TestStandardFunnel.java |   4 +-
 .../apache/nifi/util/CharacterFilterUtilsTest.java |   7 +-
 52 files changed, 821 insertions(+), 452 deletions(-)
 create mode 100644 nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/PropertiesCredentialsProvider.java
 copy nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/{service/AWSCredentialsProviderService.java => AwsCredentialsProviderService.java} (58%)


[nifi] 02/02: NIFI-10876 Converted some nifi-framework tests from JUnit 4 to JUnit 5

Posted by ex...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit e8d554d9b40f9f540d1457830721556fbd95edb1
Author: dan-s1 <ds...@gmail.com>
AuthorDate: Fri Nov 25 17:39:36 2022 +0000

    NIFI-10876 Converted some nifi-framework tests from JUnit 4 to JUnit 5
    
    This closes #6720
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../nifi/authorization/AuthorizerFactoryTest.java  |  65 ++++-----
 .../nifi/web/api/dto/TestProcessGroupDTO.java      |   9 +-
 .../nifi/web/api/dto/TestProcessGroupEntity.java   |   9 +-
 .../web/api/dto/TestRemoteProcessGroupDTO.java     |  20 ++-
 .../nifi/web/api/dto/util/TestNumberUtil.java      |   7 +-
 .../html/ProcessorDocumentationWriterTest.java     |  20 +--
 .../FileAccessPolicyProviderTest.java              |  57 +++++---
 .../nifi/authorization/FileAuthorizerTest.java     |  73 ++++++----
 .../authorization/FileUserGroupProviderTest.java   |  43 +++---
 .../resource/DataAuthorizableTest.java             |  21 +--
 .../resource/OperationAuthorizableTest.java        |   6 +-
 .../resource/ProvenanceDataAuthorizableTest.java   |  22 +--
 .../jaxb/message/TestJaxbProtocolUtils.java        |   6 +-
 .../repository/TestRingBufferEventRepository.java  |  17 ++-
 .../repository/TestStandardFlowFileRecord.java     |   7 +-
 .../repository/TestStandardProvenanceReporter.java |   6 +-
 .../metrics/TestSecondPrecisionEventContainer.java |   8 +-
 ...StandardControllerServiceInvocationHandler.java |  18 +--
 ...StandardVersionedComponentSynchronizerTest.java |  23 ++--
 .../nifi/logging/TestStandardLogRepository.java    |   6 +-
 .../parameter/TestStandardParameterContext.java    | 150 ++++++++++-----------
 .../nifi/processor/TestStandardPropertyValue.java  |  12 +-
 .../processor/TestStandardValidationContext.java   |   7 +-
 .../NiFiRegistryExtensionBundleMetadataTest.java   |   6 +-
 .../flow/mapping/TestNiFiRegistryFlowMapper.java   |   8 +-
 .../org/apache/nifi/util/ReflectionUtilsTest.java  |  36 ++---
 .../nifi/util/TestFlowDifferenceFilters.java       |  24 ++--
 .../TestControllerServiceApiMatcher.java           |  10 +-
 .../apache/nifi/controller/TestStandardFunnel.java |   4 +-
 .../apache/nifi/util/CharacterFilterUtilsTest.java |   7 +-
 30 files changed, 367 insertions(+), 340 deletions(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-authorizer/src/test/java/org/apache/nifi/authorization/AuthorizerFactoryTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-authorizer/src/test/java/org/apache/nifi/authorization/AuthorizerFactoryTest.java
index 6dbe4bbdc7..888a3842b9 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-authorizer/src/test/java/org/apache/nifi/authorization/AuthorizerFactoryTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-authorizer/src/test/java/org/apache/nifi/authorization/AuthorizerFactoryTest.java
@@ -18,20 +18,20 @@ package org.apache.nifi.authorization;
 
 import org.apache.nifi.authorization.AuthorizationResult.Result;
 import org.apache.nifi.authorization.exception.AuthorizerCreationException;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class AuthorizerFactoryTest {
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPoliciesWithSameResourceAndAction() {
         User user1 = new User.Builder().identifier("user-id-1").identity("user-1").build();
 
@@ -58,10 +58,11 @@ public class AuthorizerFactoryTest {
 
         AuthorizerConfigurationContext context = Mockito.mock(AuthorizerConfigurationContext.class);
         Authorizer authorizer = AuthorizerFactory.installIntegrityChecks(new MockPolicyBasedAuthorizer(new HashSet<>(), users, policies));
-        authorizer.onConfigured(context);
+
+        assertThrows(AuthorizerCreationException.class, () -> authorizer.onConfigured(context));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenUsersWithSameIdentity() {
         User user1 = new User.Builder().identifier("user-id-1").identity("user-1").build();
         User user2 = new User.Builder().identifier("user-id-2").identity("user-1").build();
@@ -72,10 +73,11 @@ public class AuthorizerFactoryTest {
 
         AuthorizerConfigurationContext context = Mockito.mock(AuthorizerConfigurationContext.class);
         Authorizer authorizer = AuthorizerFactory.installIntegrityChecks(new MockPolicyBasedAuthorizer(new HashSet<>(), users, new HashSet<>()));
-        authorizer.onConfigured(context);
+
+        assertThrows(AuthorizerCreationException.class, () -> authorizer.onConfigured(context));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenGroupsWithSameName() {
         Group group1 = new Group.Builder().identifier("group-id-1").name("group-1").build();
         Group group2 = new Group.Builder().identifier("group-id-2").name("group-1").build();
@@ -86,7 +88,8 @@ public class AuthorizerFactoryTest {
 
         AuthorizerConfigurationContext context = Mockito.mock(AuthorizerConfigurationContext.class);
         Authorizer authorizer = AuthorizerFactory.installIntegrityChecks(new MockPolicyBasedAuthorizer(groups, new HashSet<>(), new HashSet<>()));
-        authorizer.onConfigured(context);
+
+        assertThrows(AuthorizerCreationException.class, () -> authorizer.onConfigured(context));
     }
 
     @Test
@@ -117,12 +120,8 @@ public class AuthorizerFactoryTest {
                 .addUser(user1.getIdentifier())
                 .build();
 
-        try {
-            accessPolicyProvider.addAccessPolicy(policy2);
-            Assert.fail("Should have thrown exception");
-        } catch (IllegalStateException e) {
-
-        }
+        assertThrows(IllegalStateException.class,
+                () -> accessPolicyProvider.addAccessPolicy(policy2));
     }
 
     @Test
@@ -140,12 +139,8 @@ public class AuthorizerFactoryTest {
 
         User user2 = new User.Builder().identifier("user-id-2").identity("user-1").build();
 
-        try {
-            userGroupProvider.addUser(user2);
-            Assert.fail("Should have thrown exception");
-        } catch (IllegalStateException e) {
-
-        }
+        assertThrows(IllegalStateException.class,
+                () -> userGroupProvider.addUser(user2));
     }
 
     @Test
@@ -163,12 +158,8 @@ public class AuthorizerFactoryTest {
 
         Group group2 = new Group.Builder().identifier("group-id-2").name("group-1").build();
 
-        try {
-            userGroupProvider.addGroup(group2);
-            Assert.fail("Should have thrown exception");
-        } catch (IllegalStateException e) {
-
-        }
+        assertThrows(IllegalStateException.class,
+                () -> userGroupProvider.addGroup(group2));
     }
 
     @Test
@@ -221,13 +212,10 @@ public class AuthorizerFactoryTest {
         User user2 = new User.Builder().identifier("user-id-2").identity("xyz").build();
         userGroupProvider.addUser(user2);
 
-        try {
-            User user1Updated = new User.Builder().identifier("user-id-1").identity("xyz").build();
-            userGroupProvider.updateUser(user1Updated);
-            Assert.fail("Should have thrown exception");
-        } catch (IllegalStateException e) {
+        User user1Updated = new User.Builder().identifier("user-id-1").identity("xyz").build();
 
-        }
+        assertThrows(IllegalStateException.class,
+                () -> userGroupProvider.updateUser(user1Updated));
     }
 
     @Test
@@ -246,13 +234,10 @@ public class AuthorizerFactoryTest {
         Group group2 = new Group.Builder().identifier("group-id-2").name("xyz").build();
         userGroupProvider.addGroup(group2);
 
-        try {
-            Group group1Updated = new Group.Builder().identifier("group-id-1").name("xyz").build();
-            userGroupProvider.updateGroup(group1Updated);
-            Assert.fail("Should have thrown exception");
-        } catch (IllegalStateException e) {
+        Group group1Updated = new Group.Builder().identifier("group-id-1").name("xyz").build();
 
-        }
+        assertThrows(IllegalStateException.class,
+                () -> userGroupProvider.updateGroup(group1Updated));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupDTO.java
index 5c28b7183b..d12998c3f2 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupDTO.java
@@ -16,16 +16,17 @@
  */
 package org.apache.nifi.web.api.dto;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestProcessGroupDTO {
 
     @Test
     public void testGetInputPortCount() {
         final ProcessGroupDTO dto = new ProcessGroupDTO();
-        assertEquals(null, dto.getInputPortCount());
+        assertNull(dto.getInputPortCount());
 
         dto.setLocalInputPortCount(3);
         dto.setPublicInputPortCount(4);
@@ -38,7 +39,7 @@ public class TestProcessGroupDTO {
     @Test
     public void testGetOutputPortCount() {
         final ProcessGroupDTO dto = new ProcessGroupDTO();
-        assertEquals(null, dto.getOutputPortCount());
+        assertNull(dto.getOutputPortCount());
 
         dto.setLocalOutputPortCount(2);
         dto.setPublicOutputPortCount(3);
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupEntity.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupEntity.java
index ae4124db24..5fbfe50879 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupEntity.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestProcessGroupEntity.java
@@ -17,16 +17,17 @@
 package org.apache.nifi.web.api.dto;
 
 import org.apache.nifi.web.api.entity.ProcessGroupEntity;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestProcessGroupEntity {
 
     @Test
     public void testGetInputPortCount() {
         final ProcessGroupEntity entity = new ProcessGroupEntity();
-        assertEquals(null, entity.getInputPortCount());
+        assertNull(entity.getInputPortCount());
 
         entity.setLocalInputPortCount(3);
         entity.setPublicInputPortCount(4);
@@ -39,7 +40,7 @@ public class TestProcessGroupEntity {
     @Test
     public void testGetOutputPortCount() {
         final ProcessGroupEntity entity = new ProcessGroupEntity();
-        assertEquals(null, entity.getOutputPortCount());
+        assertNull(entity.getOutputPortCount());
 
         entity.setLocalOutputPortCount(2);
         entity.setPublicOutputPortCount(3);
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestRemoteProcessGroupDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestRemoteProcessGroupDTO.java
index ff8c61bbfb..e43ec024e2 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestRemoteProcessGroupDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/TestRemoteProcessGroupDTO.java
@@ -16,10 +16,10 @@
  */
 package org.apache.nifi.web.api.dto;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestRemoteProcessGroupDTO {
 
@@ -30,20 +30,18 @@ public class TestRemoteProcessGroupDTO {
         assertNull(dto.getTargetUri());
 
         dto.setTargetUris("http://node1:8080/nifi, http://node2:8080/nifi");
-        assertEquals("If targetUris are set but targetUri is not, it should returns the first uru of the targetUris",
-                "http://node1:8080/nifi", dto.getTargetUri());
+        assertEquals("http://node1:8080/nifi", dto.getTargetUri(),
+                "If targetUris are set but targetUri is not, it should returns the first uri of the targetUris");
         assertEquals("http://node1:8080/nifi, http://node2:8080/nifi", dto.getTargetUris());
 
         dto.setTargetUri("http://node3:9090/nifi");
-        assertEquals("If both targetUri and targetUris are set, each returns its own values",
-                "http://node3:9090/nifi", dto.getTargetUri());
+        assertEquals("http://node3:9090/nifi", dto.getTargetUri(),
+                "If both targetUri and targetUris are set, each returns its own values");
         assertEquals("http://node1:8080/nifi, http://node2:8080/nifi", dto.getTargetUris());
 
         dto.setTargetUris(null);
         assertEquals("http://node3:9090/nifi", dto.getTargetUri());
-        assertEquals("getTargetUris should return targetUri when it's not set",
-                "http://node3:9090/nifi", dto.getTargetUris());
-
+        assertEquals("http://node3:9090/nifi", dto.getTargetUris(),
+                "getTargetUris should return targetUri when it's not set");
     }
-
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/util/TestNumberUtil.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/util/TestNumberUtil.java
index 85395431f8..68cba57c5c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/util/TestNumberUtil.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/test/java/org/apache/nifi/web/api/dto/util/TestNumberUtil.java
@@ -16,10 +16,11 @@
  */
 package org.apache.nifi.web.api.dto.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.apache.nifi.web.api.dto.util.NumberUtil.sumNullableIntegers;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestNumberUtil {
 
@@ -31,7 +32,7 @@ public class TestNumberUtil {
 
         assertEquals(Integer.valueOf(0), sumNullableIntegers(-1, null, 1));
 
-        assertEquals(null, sumNullableIntegers(null, null));
+        assertNull(sumNullableIntegers(null, null));
     }
 
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/html/ProcessorDocumentationWriterTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/html/ProcessorDocumentationWriterTest.java
index c10428e33b..401bfaf6a5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/html/ProcessorDocumentationWriterTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/html/ProcessorDocumentationWriterTest.java
@@ -28,14 +28,14 @@ import org.apache.nifi.documentation.example.ProcessorWithLogger;
 import org.apache.nifi.init.ProcessorInitializer;
 import org.apache.nifi.nar.ExtensionManager;
 import org.apache.nifi.nar.StandardExtensionDiscoveringManager;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import static org.apache.nifi.documentation.html.XmlValidator.assertContains;
 import static org.apache.nifi.documentation.html.XmlValidator.assertNotContains;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class ProcessorDocumentationWriterTest {
 
@@ -115,11 +115,11 @@ public class ProcessorDocumentationWriterTest {
         assertContains(results, "Not Specified");
 
         // verify the right OnRemoved and OnShutdown methods were called
-        Assert.assertEquals(0, processor.getOnRemovedArgs());
-        Assert.assertEquals(0, processor.getOnRemovedNoArgs());
+        assertEquals(0, processor.getOnRemovedArgs());
+        assertEquals(0, processor.getOnRemovedNoArgs());
 
-        Assert.assertEquals(1, processor.getOnShutdownArgs());
-        Assert.assertEquals(1, processor.getOnShutdownNoArgs());
+        assertEquals(1, processor.getOnShutdownArgs());
+        assertEquals(1, processor.getOnShutdownNoArgs());
     }
 
     @Test
@@ -236,10 +236,10 @@ public class ProcessorDocumentationWriterTest {
         assertNotContains(results, "Additional Details...");
 
         // verify the right OnRemoved and OnShutdown methods were called
-        Assert.assertEquals(0, processor.getOnRemovedArgs());
-        Assert.assertEquals(0, processor.getOnRemovedNoArgs());
+        assertEquals(0, processor.getOnRemovedArgs());
+        assertEquals(0, processor.getOnRemovedNoArgs());
 
-        Assert.assertEquals(1, processor.getOnShutdownArgs());
-        Assert.assertEquals(1, processor.getOnShutdownNoArgs());
+        assertEquals(1, processor.getOnShutdownArgs());
+        assertEquals(1, processor.getOnShutdownNoArgs());
     }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAccessPolicyProviderTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAccessPolicyProviderTest.java
index 92ac0b4dfc..2c60e59d27 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAccessPolicyProviderTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAccessPolicyProviderTest.java
@@ -24,9 +24,9 @@ import org.apache.nifi.authorization.resource.ResourceType;
 import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.util.NiFiProperties;
 import org.apache.nifi.util.file.FileUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -41,11 +41,12 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
@@ -151,7 +152,7 @@ public class FileAccessPolicyProviderTest {
 
     private AuthorizerConfigurationContext configurationContext;
 
-    @Before
+    @BeforeEach
     public void setup() throws IOException {
         // primary authorizations
         primaryAuthorizations = new File("target/authorizations/authorizations.xml");
@@ -271,7 +272,7 @@ public class FileAccessPolicyProviderTest {
         accessPolicyProvider.initialize(initializationContext);
     }
 
-    @After
+    @AfterEach
     public void cleanup() throws Exception {
         deleteFile(primaryAuthorizations);
         deleteFile(primaryTenants);
@@ -507,17 +508,19 @@ public class FileAccessPolicyProviderTest {
         assertTrue(outputPortPolicy.getUsers().contains(user4.getIdentifier()));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenBadLegacyUsersFileProvided() throws Exception {
         when(configurationContext.getProperty(eq(FileAuthorizer.PROP_LEGACY_AUTHORIZED_USERS_FILE)))
                 .thenReturn(new StandardPropertyValue("src/test/resources/does-not-exist.xml", null, ParameterLookup.EMPTY));
 
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         writeFile(primaryTenants, EMPTY_TENANTS_CONCISE);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> accessPolicyProvider.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenInitialAdminAndLegacyUsersProvided() throws Exception {
         final String adminIdentity = "admin-user";
         when(configurationContext.getProperty(eq(FileAccessPolicyProvider.PROP_INITIAL_ADMIN_IDENTITY)))
@@ -528,7 +531,9 @@ public class FileAccessPolicyProviderTest {
 
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         writeFile(primaryTenants, EMPTY_TENANTS_CONCISE);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> accessPolicyProvider.onConfigured(configurationContext));
     }
 
     @Test
@@ -806,7 +811,7 @@ public class FileAccessPolicyProviderTest {
         assertNull(accessPolicyProvider.getAccessPolicy(ResourceType.Proxy.getValue(), RequestAction.WRITE));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenNodeGroupDoesNotExist() throws Exception {
         final String adminIdentity = "admin-user";
 
@@ -819,7 +824,9 @@ public class FileAccessPolicyProviderTest {
         writeFile(primaryTenants, TENANTS_FOR_ADMIN_AND_NODE_GROUP);
 
         userGroupProvider.onConfigured(configurationContext);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> accessPolicyProvider.onConfigured(configurationContext));
     }
 
     @Test
@@ -857,26 +864,32 @@ public class FileAccessPolicyProviderTest {
         assertEquals(primaryTenants.length(), restoreTenants.length());
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryDoesNotExist() throws Exception {
         writeFile(restoreAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         userGroupProvider.onConfigured(configurationContext);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class, () ->
+                accessPolicyProvider.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryAuthorizationsDifferentThanRestore() throws Exception {
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS);
         writeFile(restoreAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         userGroupProvider.onConfigured(configurationContext);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> accessPolicyProvider.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWithBadAuthorizationsSchema() throws Exception {
         writeFile(primaryAuthorizations, BAD_SCHEMA_AUTHORIZATIONS);
         userGroupProvider.onConfigured(configurationContext);
-        accessPolicyProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> accessPolicyProvider.onConfigured(configurationContext));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java
index b238d24f70..85aa1410d3 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java
@@ -26,11 +26,11 @@ import org.apache.nifi.authorization.resource.ResourceType;
 import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.util.NiFiProperties;
 import org.apache.nifi.util.file.FileUtils;
-import org.junit.After;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -45,12 +45,13 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -162,12 +163,12 @@ public class FileAuthorizerTest {
 
     private AuthorizerConfigurationContext configurationContext;
 
-    @BeforeClass
+    @BeforeAll
     public static void setUpSuite() {
-        Assume.assumeTrue("Test only runs on *nix", !SystemUtils.IS_OS_WINDOWS);
+        Assumptions.assumeTrue(!SystemUtils.IS_OS_WINDOWS, "Test only runs on *nix");
     }
 
-    @Before
+    @BeforeEach
     public void setup() throws IOException {
         // primary authorizations
         primaryAuthorizations = new File("target/authorizations/authorizations.xml");
@@ -247,7 +248,7 @@ public class FileAuthorizerTest {
         authorizer.initialize(null);
     }
 
-    @After
+    @AfterEach
     public void cleanup() throws Exception {
         deleteFile(primaryAuthorizations);
         deleteFile(primaryTenants);
@@ -515,17 +516,19 @@ public class FileAuthorizerTest {
         assertTrue(outputPortPolicy.getUsers().contains(user4.getIdentifier()));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenBadLegacyUsersFileProvided() throws Exception {
         when(configurationContext.getProperty(Mockito.eq(FileAuthorizer.PROP_LEGACY_AUTHORIZED_USERS_FILE)))
                 .thenReturn(new StandardPropertyValue("src/test/resources/does-not-exist.xml", null, ParameterLookup.EMPTY));
 
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         writeFile(primaryTenants, EMPTY_TENANTS_CONCISE);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenInitialAdminAndLegacyUsersProvided() throws Exception {
         final String adminIdentity = "admin-user";
         when(configurationContext.getProperty(Mockito.eq(FileAccessPolicyProvider.PROP_INITIAL_ADMIN_IDENTITY)))
@@ -536,7 +539,9 @@ public class FileAuthorizerTest {
 
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         writeFile(primaryTenants, EMPTY_TENANTS_CONCISE);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
     @Test
@@ -831,37 +836,47 @@ public class FileAuthorizerTest {
         assertEquals(primaryTenants.length(), restoreTenants.length());
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryDoesNotExist() throws Exception {
         writeFile(restoreAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
         writeFile(restoreTenants, EMPTY_TENANTS_CONCISE);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryAuthorizationsDifferentThanRestore() throws Exception {
         writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS);
         writeFile(restoreAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryTenantsDifferentThanRestore() throws Exception {
         writeFile(primaryTenants, EMPTY_TENANTS);
         writeFile(restoreTenants, EMPTY_TENANTS_CONCISE);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWithBadAuthorizationsSchema() throws Exception {
         writeFile(primaryAuthorizations, BAD_SCHEMA_AUTHORIZATIONS);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWithBadTenantsSchema() throws Exception {
         writeFile(primaryTenants, BAD_SCHEMA_TENANTS);
-        authorizer.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> authorizer.onConfigured(configurationContext));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileUserGroupProviderTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileUserGroupProviderTest.java
index 2f51e1f346..6bcae42c8e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileUserGroupProviderTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileUserGroupProviderTest.java
@@ -22,9 +22,9 @@ import org.apache.nifi.authorization.exception.AuthorizerCreationException;
 import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.util.NiFiProperties;
 import org.apache.nifi.util.file.FileUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -38,10 +38,11 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
@@ -96,7 +97,7 @@ public class FileUserGroupProviderTest {
 
     private AuthorizerConfigurationContext configurationContext;
 
-    @Before
+    @BeforeEach
     public void setup() throws IOException {
         // primary tenants
         primaryTenants = new File("target/authorizations/users.xml");
@@ -144,7 +145,7 @@ public class FileUserGroupProviderTest {
         userGroupProvider.initialize(null);
     }
 
-    @After
+    @AfterEach
     public void cleanup() throws Exception {
         deleteFile(primaryTenants);
         deleteFile(restoreTenants);
@@ -274,13 +275,15 @@ public class FileUserGroupProviderTest {
         assertEquals("GROUP1", group1.getName());
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenBadLegacyUsersFileProvided() throws Exception {
         when(configurationContext.getProperty(eq(FileAuthorizer.PROP_LEGACY_AUTHORIZED_USERS_FILE)))
                 .thenReturn(new StandardPropertyValue("src/test/resources/does-not-exist.xml", null, ParameterLookup.EMPTY));
 
         writeFile(primaryTenants, EMPTY_TENANTS_CONCISE);
-        userGroupProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> userGroupProvider.onConfigured(configurationContext));
     }
 
     @Test
@@ -356,24 +359,30 @@ public class FileUserGroupProviderTest {
         assertEquals(primaryTenants.length(), restoreTenants.length());
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryDoesNotExist() throws Exception {
         writeFile(restoreTenants, EMPTY_TENANTS_CONCISE);
-        userGroupProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> userGroupProvider.onConfigured(configurationContext));
     }
 
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWhenPrimaryTenantsDifferentThanRestore() throws Exception {
         writeFile(primaryTenants, EMPTY_TENANTS);
         writeFile(restoreTenants, EMPTY_TENANTS_CONCISE);
-        userGroupProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> userGroupProvider.onConfigured(configurationContext));
     }
 
-    @Test(expected = AuthorizerCreationException.class)
+    @Test
     public void testOnConfiguredWithBadTenantsSchema() throws Exception {
         writeFile(primaryTenants, BAD_SCHEMA_TENANTS);
-        userGroupProvider.onConfigured(configurationContext);
+
+        assertThrows(AuthorizerCreationException.class,
+                () -> userGroupProvider.onConfigured(configurationContext));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/DataAuthorizableTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/DataAuthorizableTest.java
index 331d179c7e..3bb06b1e43 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/DataAuthorizableTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/DataAuthorizableTest.java
@@ -24,10 +24,11 @@ import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.authorization.RequestAction;
 import org.apache.nifi.authorization.user.NiFiUser;
 import org.apache.nifi.authorization.user.StandardNiFiUser.Builder;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.Mockito.mock;
@@ -45,7 +46,7 @@ public class DataAuthorizableTest {
     private Authorizer testAuthorizer;
     private DataAuthorizable testDataAuthorizable;
 
-    @Before
+    @BeforeEach
     public void setup() {
         testProcessorAuthorizable = mock(Authorizable.class);
         when(testProcessorAuthorizable.getParentAuthorizable()).thenReturn(null);
@@ -69,9 +70,11 @@ public class DataAuthorizableTest {
         testDataAuthorizable = new DataAuthorizable(testProcessorAuthorizable);
     }
 
-    @Test(expected = AccessDeniedException.class)
+    @Test
     public void testAuthorizeNullUser() {
-        testDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, null, null);
+        assertThrows(AccessDeniedException.class,() ->
+                testDataAuthorizable.authorize(testAuthorizer, RequestAction.READ,
+                        null, null));
     }
 
     @Test
@@ -80,10 +83,12 @@ public class DataAuthorizableTest {
         assertEquals(Result.Denied, result.getResult());
     }
 
-    @Test(expected = AccessDeniedException.class)
+    @Test
     public void testAuthorizeUnauthorizedUser() {
         final NiFiUser user = new Builder().identity("unknown").build();
-        testDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, user, null);
+
+        assertThrows(AccessDeniedException.class, () ->
+            testDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, user, null));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/OperationAuthorizableTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/OperationAuthorizableTest.java
index 87a4fc48b3..669a8c3db6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/OperationAuthorizableTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/OperationAuthorizableTest.java
@@ -22,12 +22,12 @@ import org.apache.nifi.authorization.MockPolicyBasedAuthorizer;
 import org.apache.nifi.authorization.Resource;
 import org.apache.nifi.authorization.User;
 import org.apache.nifi.authorization.user.StandardNiFiUser;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.apache.nifi.authorization.RequestAction.READ;
 import static org.apache.nifi.authorization.RequestAction.WRITE;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class OperationAuthorizableTest {
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/ProvenanceDataAuthorizableTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/ProvenanceDataAuthorizableTest.java
index 98c555b827..42af7d3d33 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/ProvenanceDataAuthorizableTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-authorization/src/test/java/org/apache/nifi/authorization/resource/ProvenanceDataAuthorizableTest.java
@@ -24,10 +24,11 @@ import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.authorization.RequestAction;
 import org.apache.nifi.authorization.user.NiFiUser;
 import org.apache.nifi.authorization.user.StandardNiFiUser.Builder;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.Mockito.mock;
@@ -42,7 +43,7 @@ public class ProvenanceDataAuthorizableTest {
     private Authorizer testAuthorizer;
     private ProvenanceDataAuthorizable testProvenanceDataAuthorizable;
 
-    @Before
+    @BeforeEach
     public void setup() {
         Authorizable testProcessorAuthorizable;
         testProcessorAuthorizable = mock(Authorizable.class);
@@ -63,9 +64,11 @@ public class ProvenanceDataAuthorizableTest {
         testProvenanceDataAuthorizable = new ProvenanceDataAuthorizable(testProcessorAuthorizable);
     }
 
-    @Test(expected = AccessDeniedException.class)
+    @Test
     public void testAuthorizeNullUser() {
-        testProvenanceDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, null, null);
+        assertThrows( AccessDeniedException.class, () ->
+            testProvenanceDataAuthorizable.authorize(testAuthorizer, RequestAction.READ,
+                    null, null));
     }
 
     @Test
@@ -74,10 +77,13 @@ public class ProvenanceDataAuthorizableTest {
         assertEquals(Result.Denied, result.getResult());
     }
 
-    @Test(expected = AccessDeniedException.class)
+    @Test
     public void testAuthorizeUnauthorizedUser() {
         final NiFiUser user = new Builder().identity("unknown").build();
-        testProvenanceDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, user, null);
+
+        assertThrows(AccessDeniedException.class, () ->
+            testProvenanceDataAuthorizable.authorize(testAuthorizer, RequestAction.READ, user,
+                    null));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/test/java/org/apache/nifi/cluster/protocol/jaxb/message/TestJaxbProtocolUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/test/java/org/apache/nifi/cluster/protocol/jaxb/message/TestJaxbProtocolUtils.java
index d45bf4a2e0..3848bd8502 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/test/java/org/apache/nifi/cluster/protocol/jaxb/message/TestJaxbProtocolUtils.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/test/java/org/apache/nifi/cluster/protocol/jaxb/message/TestJaxbProtocolUtils.java
@@ -35,7 +35,7 @@ import org.apache.nifi.cluster.protocol.message.HeartbeatMessage;
 import org.apache.nifi.cluster.protocol.message.NodeConnectionStatusRequestMessage;
 import org.apache.nifi.cluster.protocol.message.NodeConnectionStatusResponseMessage;
 import org.apache.nifi.web.Revision;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import javax.xml.bind.JAXBException;
 import java.io.ByteArrayInputStream;
@@ -47,8 +47,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.IntStream;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestJaxbProtocolUtils {
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestRingBufferEventRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestRingBufferEventRepository.java
index cb5d8dd8e0..ec27713ae2 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestRingBufferEventRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestRingBufferEventRepository.java
@@ -17,14 +17,17 @@
 package org.apache.nifi.controller.repository;
 
 import org.apache.nifi.controller.repository.metrics.RingBufferEventRepository;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+
 public class TestRingBufferEventRepository {
 
     @Test
@@ -57,21 +60,21 @@ public class TestRingBufferEventRepository {
         repo.updateRepository(generateEvent(), id2);
         RepositoryStatusReport report = repo.reportTransferEvents(System.currentTimeMillis());
         FlowFileEvent entry = report.getReportEntry(id1);
-        Assert.assertNotNull(entry);
+        assertNotNull(entry);
         entry = report.getReportEntry(id2);
-        Assert.assertNotNull(entry);
+        assertNotNull(entry);
 
         repo.purgeTransferEvents(id1);
         report = repo.reportTransferEvents(System.currentTimeMillis());
         entry = report.getReportEntry(id1);
-        Assert.assertNull(entry);
+        assertNull(entry);
         entry = report.getReportEntry(id2);
-        Assert.assertNotNull(entry);
+        assertNotNull(entry);
 
         repo.purgeTransferEvents(id2);
         report = repo.reportTransferEvents(System.currentTimeMillis());
         entry = report.getReportEntry(id2);
-        Assert.assertNull(entry);
+        assertNull(entry);
 
         repo.close();
     }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardFlowFileRecord.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardFlowFileRecord.java
index 55c0e3e3a9..b4b525cd10 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardFlowFileRecord.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardFlowFileRecord.java
@@ -17,14 +17,14 @@
 
 package org.apache.nifi.controller.repository;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class TestStandardFlowFileRecord {
 
@@ -56,5 +56,4 @@ public class TestStandardFlowFileRecord {
         assertEquals(original.getAttributes(), removeAttribute.getAttributes());
         assertEquals(addAttributeMapCopy, addAttribute.getAttributes());
     }
-
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardProvenanceReporter.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardProvenanceReporter.java
index c079163250..43eead433e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardProvenanceReporter.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/TestStandardProvenanceReporter.java
@@ -25,14 +25,14 @@ import java.util.Set;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.provenance.ProvenanceEventRecord;
 import org.apache.nifi.provenance.ProvenanceEventRepository;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
 public class TestStandardProvenanceReporter {
 
     @Test
-    @Ignore
+    @Disabled
     public void testDuplicatesIgnored() {
         final ProvenanceEventRepository mockRepo = Mockito.mock(ProvenanceEventRepository.class);
         final StandardProvenanceReporter reporter = new StandardProvenanceReporter(null, "1234", "TestProc", mockRepo, null);
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/metrics/TestSecondPrecisionEventContainer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/metrics/TestSecondPrecisionEventContainer.java
index f8b4559416..2d22ce7610 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/metrics/TestSecondPrecisionEventContainer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/repository/metrics/TestSecondPrecisionEventContainer.java
@@ -17,9 +17,9 @@
 package org.apache.nifi.controller.repository.metrics;
 
 import org.apache.nifi.controller.repository.FlowFileEvent;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class TestSecondPrecisionEventContainer {
 
@@ -39,8 +39,8 @@ public class TestSecondPrecisionEventContainer {
 
             final long timestamp = startTime + 300_000 * i + 300_000;
             final FlowFileEvent result = container.generateReport(timestamp);
-            assertEquals("Failure at i=" + i, 300 * 100, result.getBytesRead());
-            assertEquals("Failure at i=" + i, 300 * 100, result.getBytesWritten());
+            assertEquals(300 * 100, result.getBytesRead(), "Failure at i=" + i);
+            assertEquals( 300 * 100, result.getBytesWritten(), "Failure at i=" + i);
         }
     }
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceInvocationHandler.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceInvocationHandler.java
index 7d94b372d5..e7b741665b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceInvocationHandler.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceInvocationHandler.java
@@ -20,25 +20,25 @@ package org.apache.nifi.controller.service;
 import org.apache.nifi.controller.AbstractControllerService;
 import org.apache.nifi.controller.ControllerService;
 import org.apache.nifi.nar.ExtensionManager;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
 import java.lang.reflect.Proxy;
 import java.net.URL;
 import java.net.URLClassLoader;
 
-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.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestStandardControllerServiceInvocationHandler {
 
     private ClassLoader originalClassLoader;
 
-    @Before
+    @BeforeEach
     public void setEmptyClassLoader() {
         this.originalClassLoader = Thread.currentThread().getContextClassLoader();
 
@@ -47,7 +47,7 @@ public class TestStandardControllerServiceInvocationHandler {
         Thread.currentThread().setContextClassLoader(classLoader);
     }
 
-    @After
+    @AfterEach
     public void setOriginalClassLoaderBack() {
         if (originalClassLoader != null) Thread.currentThread().setContextClassLoader(originalClassLoader);
     }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizerTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizerTest.java
index 96445ab437..8a91c011ec 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizerTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizerTest.java
@@ -67,7 +67,6 @@ import org.apache.nifi.processor.Relationship;
 import org.apache.nifi.registry.flow.mapping.FlowMappingOptions;
 import org.apache.nifi.scheduling.ExecutionNode;
 import org.apache.nifi.scheduling.SchedulingStrategy;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -94,10 +93,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.AdditionalMatchers.or;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -532,7 +532,7 @@ public class StandardVersionedComponentSynchronizerTest {
         verify(connectionAB, times(0)).setName("Hello");
 
         // Ensure that the source was stopped but not restarted. We don't restart in this situation because the intent is to drop
-        // the connection so we will leave the source stopped so that the data can eventually drain from the queue and the connection
+        // the connection, so we will leave the source stopped so that the data can eventually drain from the queue and the connection
         // can be removed.
         verifyStopped(processorA);
         verifyNotRestarted(processorA);
@@ -548,12 +548,10 @@ public class StandardVersionedComponentSynchronizerTest {
         // Use a background thread to synchronize the connection.
         final CountDownLatch completionLatch = new CountDownLatch(1);
         final Thread syncThread = new Thread(() -> {
-            try {
+            assertDoesNotThrow(() -> {
                 synchronizer.synchronize(connectionAB, null, group, synchronizationOptions);
                 completionLatch.countDown();
-            } catch (final Exception e) {
-                Assert.fail(e.toString());
-            }
+            });
         });
         syncThread.start();
 
@@ -1195,7 +1193,7 @@ public class StandardVersionedComponentSynchronizerTest {
         }
 
         void assertNumProcessorUpdates(int expectedNum) {
-            assertEquals("Expected " + expectedNum + " processor state changes", expectedNum, processorUpdates.size());
+            assertEquals(expectedNum, processorUpdates.size(), "Expected " + expectedNum + " processor state changes");
         }
 
         void assertProcessorUpdates(final ScheduledStateUpdate<ProcessorNode>... updates) {
@@ -1212,7 +1210,8 @@ public class StandardVersionedComponentSynchronizerTest {
         }
 
         void assertNumPortUpdates(int expectedNum) {
-            assertEquals("Expected " + expectedNum + " port state changes", expectedNum, portUpdates.size());
+            assertEquals(expectedNum, portUpdates.size(),
+                    "Expected " + expectedNum + " port state changes");
         }
     }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/logging/TestStandardLogRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/logging/TestStandardLogRepository.java
index 22bbffffd4..a5381bacd4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/logging/TestStandardLogRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/logging/TestStandardLogRepository.java
@@ -20,14 +20,14 @@ package org.apache.nifi.logging;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
 import org.apache.nifi.logging.repository.StandardLogRepository;
 import org.apache.nifi.util.MockFlowFile;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestStandardLogRepository {
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
index c1671f8aec..b92efed25e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
@@ -20,8 +20,7 @@ import org.apache.nifi.controller.ProcessorNode;
 import org.apache.nifi.controller.service.ControllerServiceNode;
 import org.apache.nifi.controller.service.ControllerServiceState;
 import org.apache.nifi.groups.ProcessGroup;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.mockito.ArgumentMatchers;
 import org.mockito.Mockito;
 
@@ -34,11 +33,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import static junit.framework.TestCase.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class TestStandardParameterContext {
 
@@ -229,21 +230,15 @@ public class TestStandardParameterContext {
         updatedParameters.put("foo", new Parameter(fooDescriptor, "baz"));
         updatedParameters.put("xyz", new Parameter(sensitiveXyzDescriptor, "242526"));
 
-        try {
-            context.setParameters(updatedParameters);
-            Assert.fail("Succeeded in changing parameter from non-sensitive to sensitive");
-        } catch (final IllegalStateException expected) {
-        }
+        assertThrows(IllegalStateException.class,
+                () -> context.setParameters(updatedParameters));
 
         final ParameterDescriptor insensitiveAbcDescriptor = new ParameterDescriptor.Builder().name("abc").sensitive(false).build();
         updatedParameters.clear();
         updatedParameters.put("abc", new Parameter(insensitiveAbcDescriptor, "123"));
 
-        try {
-            context.setParameters(updatedParameters);
-            Assert.fail("Succeeded in changing parameter from sensitive to non-sensitive");
-        } catch (final IllegalStateException expected) {
-        }
+        assertThrows(IllegalStateException.class,
+                () -> context.setParameters(updatedParameters));
     }
 
     @Test
@@ -272,18 +267,16 @@ public class TestStandardParameterContext {
         parameters.put("abc", new Parameter(abcDescriptor, "123"));
 
         // Cannot update parameters while running
-        Assert.assertThrows(IllegalStateException.class, () -> context.setParameters(parameters));
+        assertThrows(IllegalStateException.class, () -> context.setParameters(parameters));
 
         // This passes no parameters to update, so it should be fine
         context.setParameters(Collections.emptyMap());
 
         parameters.clear();
         parameters.put("abc", new Parameter(abcDescriptor, null));
-        try {
-            context.setParameters(parameters);
-            Assert.fail("Was able to remove parameter while referencing processor was running");
-        } catch (final IllegalStateException expected) {
-        }
+
+        assertThrows(IllegalStateException.class,
+                () -> context.setParameters(parameters));
 
         assertEquals("321", context.getParameter("abc").get().getValue());
     }
@@ -313,36 +306,32 @@ public class TestStandardParameterContext {
         final ProcessorNode procNode = getProcessorNode(inheritedParamName, referenceManager);
 
         // Show that inherited param 'def' starts with the original value from B
-        Assert.assertEquals(originalValue, a.getParameter(inheritedParamName).get().getValue());
+        assertEquals(originalValue, a.getParameter(inheritedParamName).get().getValue());
 
         // Now demonstrate that we can't effectively add the parameter by referencing Context B while processor runs
         a.setInheritedParameterContexts(Collections.emptyList()); // A now no longer includes 'def'
         startProcessor(procNode);
         try {
             a.setInheritedParameterContexts(Arrays.asList(b));
-            Assert.fail("Was able to change effective parameter while referencing processor was running");
+            fail("Was able to change effective parameter while referencing processor was running");
         } catch (final IllegalStateException expected) {
-            Assert.assertTrue(expected.getMessage().contains("def"));
+            assertTrue(expected.getMessage().contains("def"));
         }
 
         // Safely add Context B, and show we can't effectively remove 'def' while processor runs
         stopProcessor(procNode);
         a.setInheritedParameterContexts(Arrays.asList(b));
         startProcessor(procNode);
-        try {
-            a.setInheritedParameterContexts(Collections.emptyList());
-            Assert.fail("Was able to remove parameter while referencing processor was running");
-        } catch (final IllegalStateException expected) {
-            Assert.assertTrue(expected.getMessage().contains("def"));
-        }
+
+        IllegalStateException illegalStateException =
+                assertThrows(IllegalStateException.class,
+                        () -> a.setInheritedParameterContexts(Collections.emptyList()));
+        assertTrue(illegalStateException.getMessage().contains("def"));
 
         // Show we can't effectively change the value by changing it in B
-        try {
-            addParameter(b, inheritedParamName, changedValue);
-            Assert.fail("Was able to change parameter while referencing processor was running");
-        } catch (final IllegalStateException expected) {
-            Assert.assertTrue(expected.getMessage().contains("def"));
-        }
+        illegalStateException = assertThrows(IllegalStateException.class,
+                        () -> a.setInheritedParameterContexts(Collections.emptyList()));
+        assertTrue(illegalStateException.getMessage().contains("def"));
         assertEquals(originalValue, a.getParameter(inheritedParamName).get().getValue());
 
         // Show we can't effectively change the value by adding Context C with 'def' ahead of 'B'
@@ -351,12 +340,9 @@ public class TestStandardParameterContext {
         addParameter(c, inheritedParamName, changedValue);
         startProcessor(procNode);
 
-        try {
-            a.setInheritedParameterContexts(Arrays.asList(c, b));
-            Assert.fail("Was able to change parameter while referencing processor was running");
-        } catch (final IllegalStateException expected) {
-            Assert.assertTrue(expected.getMessage().contains("def"));
-        }
+        illegalStateException = assertThrows(IllegalStateException.class,
+                () ->  a.setInheritedParameterContexts(Arrays.asList(c, b)));
+        assertTrue(illegalStateException.getMessage().contains("def"));
         assertEquals(originalValue, a.getParameter(inheritedParamName).get().getValue());
 
         // Show that if the effective value of 'def' doesn't change, we don't prevent updating
@@ -372,7 +358,7 @@ public class TestStandardParameterContext {
         // Show that updating a value on a grandchild is prevented because the processor is running and
         // references the parameter via the grandparent
         startProcessor(procNode);
-        Assert.assertThrows(IllegalStateException.class, () -> removeParameter(c, inheritedParamName));
+        assertThrows(IllegalStateException.class, () -> removeParameter(c, inheritedParamName));
     }
 
     private static ProcessorNode getProcessorNode(String parameterName, HashMapParameterReferenceManager referenceManager) {
@@ -462,21 +448,21 @@ public class TestStandardParameterContext {
         for (final ControllerServiceState state : EnumSet.of(ControllerServiceState.ENABLED, ControllerServiceState.ENABLING, ControllerServiceState.DISABLING)) {
             setControllerServiceState(serviceNode, state);
 
-            Assert.assertThrows(IllegalStateException.class, () -> addParameter(b, inheritedParamName, changedValue));
+            assertThrows(IllegalStateException.class, () -> addParameter(b, inheritedParamName, changedValue));
 
-            Assert.assertThrows(IllegalStateException.class, () -> b.setInheritedParameterContexts(Collections.singletonList(c)));
+            assertThrows(IllegalStateException.class, () -> b.setInheritedParameterContexts(Collections.singletonList(c)));
 
             assertEquals(originalValue, a.getParameter(inheritedParamName).get().getValue());
         }
 
-        Assert.assertThrows(IllegalStateException.class, () -> removeParameter(b, inheritedParamName));
+        assertThrows(IllegalStateException.class, () -> removeParameter(b, inheritedParamName));
         setControllerServiceState(serviceNode, ControllerServiceState.DISABLED);
 
         b.setInheritedParameterContexts(Collections.singletonList(c));
 
         setControllerServiceState(serviceNode, ControllerServiceState.DISABLING);
 
-        Assert.assertThrows(IllegalStateException.class, () -> b.setInheritedParameterContexts(Collections.emptyList()));
+        assertThrows(IllegalStateException.class, () -> b.setInheritedParameterContexts(Collections.emptyList()));
     }
 
     @Test
@@ -502,7 +488,7 @@ public class TestStandardParameterContext {
 
             try {
                 context.setParameters(parameters);
-                Assert.fail("Was able to update parameter being referenced by Controller Service that is " + state);
+                fail("Was able to update parameter being referenced by Controller Service that is " + state);
             } catch (final IllegalStateException expected) {
             }
 
@@ -515,7 +501,7 @@ public class TestStandardParameterContext {
         parameters.put("abc", new Parameter(abcDescriptor, null));
         try {
             context.setParameters(parameters);
-            Assert.fail("Was able to remove parameter being referenced by Controller Service that is DISABLING");
+            fail("Was able to remove parameter being referenced by Controller Service that is DISABLING");
         } catch (final IllegalStateException expected) {
         }
     }
@@ -548,7 +534,7 @@ public class TestStandardParameterContext {
 
         b.setInheritedParameterContexts(Arrays.asList(d, e));
 
-        Assert.assertThrows(IllegalStateException.class, () -> a.setInheritedParameterContexts(Arrays.asList(b, c)));
+        assertThrows(IllegalStateException.class, () -> a.setInheritedParameterContexts(Arrays.asList(b, c)));
     }
 
     @Test
@@ -587,9 +573,9 @@ public class TestStandardParameterContext {
         d.setInheritedParameterContexts(Arrays.asList(f));
 
         a.setInheritedParameterContexts(Arrays.asList(b, c));
-        Assert.assertEquals(Arrays.asList(b, c), a.getInheritedParameterContexts());
+        assertEquals(Arrays.asList(b, c), a.getInheritedParameterContexts());
 
-        Assert.assertArrayEquals(new String[] {"B", "C"}, a.getInheritedParameterContextNames().toArray());
+        assertArrayEquals(new String[] {"B", "C"}, a.getInheritedParameterContextNames().toArray());
     }
 
     @Test
@@ -626,22 +612,22 @@ public class TestStandardParameterContext {
 
         final Map<ParameterDescriptor, Parameter> effectiveParameters = a.getEffectiveParameters();
 
-        Assert.assertEquals(5, effectiveParameters.size());
+        assertEquals(5, effectiveParameters.size());
 
-        Assert.assertEquals("a.foo", effectiveParameters.get(foo).getValue());
-        Assert.assertEquals("a", effectiveParameters.get(foo).getParameterContextId());
+        assertEquals("a.foo", effectiveParameters.get(foo).getValue());
+        assertEquals("a", effectiveParameters.get(foo).getParameterContextId());
 
-        Assert.assertEquals("a.bar", effectiveParameters.get(bar).getValue());
-        Assert.assertEquals("a", effectiveParameters.get(bar).getParameterContextId());
+        assertEquals("a.bar", effectiveParameters.get(bar).getValue());
+        assertEquals("a", effectiveParameters.get(bar).getParameterContextId());
 
-        Assert.assertEquals("b.child", effectiveParameters.get(child).getValue());
-        Assert.assertEquals("b", effectiveParameters.get(child).getParameterContextId());
+        assertEquals("b.child", effectiveParameters.get(child).getValue());
+        assertEquals("b", effectiveParameters.get(child).getParameterContextId());
 
-        Assert.assertEquals("c.secondChild", effectiveParameters.get(secondChild).getValue());
-        Assert.assertEquals("c", effectiveParameters.get(secondChild).getParameterContextId());
+        assertEquals("c.secondChild", effectiveParameters.get(secondChild).getValue());
+        assertEquals("c", effectiveParameters.get(secondChild).getParameterContextId());
 
-        Assert.assertEquals("d.grandchild", effectiveParameters.get(grandchild).getValue());
-        Assert.assertEquals("d", effectiveParameters.get(grandchild).getParameterContextId());
+        assertEquals("d.grandchild", effectiveParameters.get(grandchild).getValue());
+        assertEquals("d", effectiveParameters.get(grandchild).getParameterContextId());
     }
 
     @Test
@@ -674,10 +660,10 @@ public class TestStandardParameterContext {
 
         final Map<ParameterDescriptor, Parameter> effectiveParameters = a.getEffectiveParameters();
 
-        Assert.assertEquals(1, effectiveParameters.size());
+        assertEquals(1, effectiveParameters.size());
 
-        Assert.assertEquals("c.child", effectiveParameters.get(child).getValue());
-        Assert.assertEquals("c", effectiveParameters.get(child).getParameterContextId());
+        assertEquals("c.child", effectiveParameters.get(child).getValue());
+        assertEquals("c", effectiveParameters.get(child).getParameterContextId());
     }
 
     @Test
@@ -693,7 +679,7 @@ public class TestStandardParameterContext {
         addParameter(b, "child", "b.child", false);
 
         a.setInheritedParameterContexts(Arrays.asList(b));
-        Assert.assertEquals(Arrays.asList(b), a.getInheritedParameterContexts());
+        assertEquals(Arrays.asList(b), a.getInheritedParameterContexts());
     }
 
     @Test
@@ -710,14 +696,14 @@ public class TestStandardParameterContext {
         b.setInheritedParameterContexts(Arrays.asList(c, d));
         d.setInheritedParameterContexts(Arrays.asList(e));
 
-        Assert.assertTrue(a.inheritsFrom("b"));
-        Assert.assertTrue(a.inheritsFrom("c"));
-        Assert.assertTrue(a.inheritsFrom("d"));
-        Assert.assertTrue(a.inheritsFrom("e"));
-        Assert.assertFalse(a.inheritsFrom("a"));
+        assertTrue(a.inheritsFrom("b"));
+        assertTrue(a.inheritsFrom("c"));
+        assertTrue(a.inheritsFrom("d"));
+        assertTrue(a.inheritsFrom("e"));
+        assertFalse(a.inheritsFrom("a"));
 
-        Assert.assertTrue(b.inheritsFrom("e"));
-        Assert.assertFalse(b.inheritsFrom("a"));
+        assertTrue(b.inheritsFrom("e"));
+        assertFalse(b.inheritsFrom("a"));
 
     }
 
@@ -735,11 +721,11 @@ public class TestStandardParameterContext {
 
         try {
             a.setInheritedParameterContexts(Arrays.asList(b));
-            Assert.fail("Should get a failure for sensitivity mismatch in overriding");
+            fail("Should get a failure for sensitivity mismatch in overriding");
         } catch (IllegalStateException e) {
-            Assert.assertTrue(e.getMessage().contains("foo"));
+            assertTrue(e.getMessage().contains("foo"));
         }
-        Assert.assertEquals(Collections.emptyList(), a.getInheritedParameterContexts());
+        assertEquals(Collections.emptyList(), a.getInheritedParameterContexts());
 
         // Now switch and set a.foo to non-sensitive and b.foo to sensitive
         removeParameter(a, "foo");
@@ -750,11 +736,11 @@ public class TestStandardParameterContext {
 
         try {
             a.setInheritedParameterContexts(Arrays.asList(b));
-            Assert.fail("Should get a failure for sensitivity mismatch in overriding");
+            fail("Should get a failure for sensitivity mismatch in overriding");
         } catch (IllegalStateException e) {
-            Assert.assertTrue(e.getMessage().contains("foo"));
+            assertTrue(e.getMessage().contains("foo"));
         }
-        Assert.assertEquals(Collections.emptyList(), a.getInheritedParameterContexts());
+        assertEquals(Collections.emptyList(), a.getInheritedParameterContexts());
     }
 
     private static void removeParameter(final ParameterContext parameterContext, final String name) {
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardPropertyValue.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardPropertyValue.java
index fbefcc108f..6f49d80b86 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardPropertyValue.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardPropertyValue.java
@@ -23,15 +23,16 @@ import org.apache.nifi.controller.ControllerService;
 import org.apache.nifi.controller.ControllerServiceLookup;
 import org.apache.nifi.controller.repository.StandardFlowFileRecord;
 import org.apache.nifi.flowfile.FlowFile;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 
 public class TestStandardPropertyValue {
@@ -97,13 +98,14 @@ public class TestStandardPropertyValue {
         assertEquals(139, value.evaluateAttributeExpressions(createFlowFile(attributes)).asInteger().intValue());
     }
 
-    @Test(expected = NumberFormatException.class)
+    @Test()
     public void testGetValueAsIntegerAfterSubstitutingWithNonInteger() {
         final PropertyValue value = new StandardPropertyValue("1${value}", lookup, ParameterLookup.EMPTY);
         final Map<String, String> attributes = new HashMap<>();
         attributes.put("value", "Yes");
         final PropertyValue substituted = value.evaluateAttributeExpressions(createFlowFile(attributes));
-        substituted.asInteger();
+
+        assertThrows(NumberFormatException.class, substituted::asInteger);
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardValidationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardValidationContext.java
index cb761fae4f..b652ee3fc1 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardValidationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/processor/TestStandardValidationContext.java
@@ -24,15 +24,15 @@ import org.apache.nifi.controller.service.ControllerServiceProvider;
 import org.apache.nifi.parameter.StandardParameterTokenList;
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.registry.VariableRegistry;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.Function;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
 
 public class TestStandardValidationContext {
@@ -77,5 +77,4 @@ public class TestStandardValidationContext {
         // Property A's dependency should still (always) satisfied b/c no dependency
         assertTrue(context.isDependencySatisfied(descriptorA, propertyLookup));
     }
-
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/NiFiRegistryExtensionBundleMetadataTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/NiFiRegistryExtensionBundleMetadataTest.java
index 74cba5c209..bb0ab374d0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/NiFiRegistryExtensionBundleMetadataTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/NiFiRegistryExtensionBundleMetadataTest.java
@@ -17,10 +17,10 @@
 package org.apache.nifi.registry;
 
 import org.apache.nifi.registry.extension.NiFiRegistryExtensionBundleMetadata;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class NiFiRegistryExtensionBundleMetadataTest {
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/flow/mapping/TestNiFiRegistryFlowMapper.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/flow/mapping/TestNiFiRegistryFlowMapper.java
index b168dfcce6..a29cd5b6dd 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/flow/mapping/TestNiFiRegistryFlowMapper.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/registry/flow/mapping/TestNiFiRegistryFlowMapper.java
@@ -37,7 +37,7 @@ import org.apache.nifi.parameter.ParameterReference;
 import org.apache.nifi.parameter.ParameterTokenList;
 import org.apache.nifi.scheduling.ExecutionNode;
 import org.apache.nifi.scheduling.SchedulingStrategy;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.mockito.stubbing.Answer;
 
 import java.util.ArrayList;
@@ -48,9 +48,9 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.UUID;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java
index 8a956db66d..59c2a2212b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java
@@ -16,25 +16,26 @@
  */
 package org.apache.nifi.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.logging.ComponentLog;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.nifi.annotation.lifecycle.OnStopped;
-import org.apache.nifi.logging.ComponentLog;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 
 public class ReflectionUtilsTest {
 
-    private List<String> invocations = new ArrayList<>();
+    private final List<String> invocations = new ArrayList<>();
 
-    @Before
+    @BeforeEach
     public void reset() {
         this.invocations.clear();
     }
@@ -66,9 +67,10 @@ public class ReflectionUtilsTest {
         assertEquals("D", this.invocations.get(0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void validateFailureWithWrongArgumentType() throws Exception {
-        ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new B(), "foo");
+        assertThrows(IllegalArgumentException.class, () ->
+                ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new B(), "foo"));
     }
 
     @Test
@@ -86,9 +88,10 @@ public class ReflectionUtilsTest {
         assertEquals("E", this.invocations.get(0));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void validateFailureIfOneOfArgumentsWrongType() throws Exception {
-        ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new E(), 3, "hjk", "hjk");
+        assertThrows(IllegalArgumentException.class, () ->
+            ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new E(), 3, "hjk", "hjk"));
     }
 
     @Test
@@ -98,9 +101,10 @@ public class ReflectionUtilsTest {
         verify(pl, Mockito.atMost(1)).error(Mockito.anyString());
     }
 
-    @Test(expected = InvocationTargetException.class)
+    @Test
     public void validateInvocationFailure() throws Exception {
-        ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new F(), 3);
+        assertThrows(InvocationTargetException.class, () ->
+            ReflectionUtils.invokeMethodsWithAnnotation(OnStopped.class, new F(), 3));
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/TestFlowDifferenceFilters.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/TestFlowDifferenceFilters.java
index 9adebff5ae..a606769cea 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/TestFlowDifferenceFilters.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/test/java/org/apache/nifi/util/TestFlowDifferenceFilters.java
@@ -24,8 +24,10 @@ import org.apache.nifi.flow.VersionedProcessor;
 import org.apache.nifi.flow.VersionedRemoteGroupPort;
 import org.apache.nifi.registry.flow.diff.DifferenceType;
 import org.apache.nifi.registry.flow.diff.StandardFlowDifference;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestFlowDifferenceFilters {
 
@@ -38,7 +40,7 @@ public class TestFlowDifferenceFilters {
                 DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");
 
         // predicate should return false because we don't want to include changes for adding a remote input port
-        Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
+        assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
     }
 
     @Test
@@ -50,7 +52,7 @@ public class TestFlowDifferenceFilters {
                 DifferenceType.COMPONENT_ADDED, remoteGroupPort, null, null, null, "");
 
         // predicate should return false because we don't want to include changes for adding a remote input port
-        Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
+        assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
     }
 
     @Test
@@ -62,7 +64,7 @@ public class TestFlowDifferenceFilters {
                 DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");
 
         // predicate should return false because we don't want to include changes for adding a remote input port
-        Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
+        assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
     }
 
     @Test
@@ -74,7 +76,7 @@ public class TestFlowDifferenceFilters {
                 DifferenceType.COMPONENT_ADDED, null, versionedProcessor, null, null, "");
 
         // predicate should return true because we do want to include changes for adding a non-port
-        Assert.assertTrue(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
+        assertTrue(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
     }
 
     @Test
@@ -97,7 +99,7 @@ public class TestFlowDifferenceFilters {
                 coordinatesA.getRegistryUrl(), coordinatesB.getRegistryUrl(),
                 "");
 
-        Assert.assertFalse(FlowDifferenceFilters.FILTER_IGNORABLE_VERSIONED_FLOW_COORDINATE_CHANGES.test(flowDifference));
+        assertFalse(FlowDifferenceFilters.FILTER_IGNORABLE_VERSIONED_FLOW_COORDINATE_CHANGES.test(flowDifference));
     }
 
     @Test
@@ -120,7 +122,7 @@ public class TestFlowDifferenceFilters {
                 coordinatesA.getRegistryUrl(), coordinatesB.getRegistryUrl(),
                 "");
 
-        Assert.assertTrue(FlowDifferenceFilters.FILTER_IGNORABLE_VERSIONED_FLOW_COORDINATE_CHANGES.test(flowDifference));
+        assertTrue(FlowDifferenceFilters.FILTER_IGNORABLE_VERSIONED_FLOW_COORDINATE_CHANGES.test(flowDifference));
     }
 
     @Test
@@ -134,7 +136,7 @@ public class TestFlowDifferenceFilters {
                 "http://localhost:18080", "http://localhost:17080",
                 "");
 
-        Assert.assertTrue(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
+        assertTrue(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
     }
 
     @Test
@@ -148,7 +150,7 @@ public class TestFlowDifferenceFilters {
                 "Port A", "Port B",
                 "");
 
-        Assert.assertTrue(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
+        assertTrue(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
     }
 
     @Test
@@ -165,7 +167,7 @@ public class TestFlowDifferenceFilters {
                 "Port A", "Port B",
                 "");
 
-        Assert.assertFalse(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
+        assertFalse(FlowDifferenceFilters.FILTER_PUBLIC_PORT_NAME_CHANGES.test(flowDifference));
     }
 }
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestControllerServiceApiMatcher.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestControllerServiceApiMatcher.java
index 4bc1849ef2..0cde7a6949 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestControllerServiceApiMatcher.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestControllerServiceApiMatcher.java
@@ -20,20 +20,20 @@ import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.components.ValidationContext;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.reporting.InitializationException;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.Collection;
 import java.util.List;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestControllerServiceApiMatcher {
 
     private ControllerServiceApiMatcher serviceApiMatcher;
 
-    @Before
+    @BeforeEach
     public void setup() {
         this.serviceApiMatcher = new ControllerServiceApiMatcher();
     }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestStandardFunnel.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestStandardFunnel.java
index 799eb20ecb..1c2dda3cc6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestStandardFunnel.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/controller/TestStandardFunnel.java
@@ -17,9 +17,9 @@
 
 package org.apache.nifi.controller;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class TestStandardFunnel {
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/util/CharacterFilterUtilsTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/util/CharacterFilterUtilsTest.java
index 216cbcdd8c..bcf9d7c9ce 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/util/CharacterFilterUtilsTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/test/java/org/apache/nifi/util/CharacterFilterUtilsTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.nifi.util;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CharacterFilterUtilsTest {
 
@@ -27,7 +27,6 @@ public class CharacterFilterUtilsTest {
         final String filtered = CharacterFilterUtils.filterInvalidXmlCharacters(text);
 
         final String expected = "This is an example with characters that need to be filtered  in it. ";
-        Assert.assertEquals(expected, filtered);
+        assertEquals(expected, filtered);
     }
-
 }
\ No newline at end of file


[nifi] 01/02: NIFI-10791 Added AWS SDK v2 support to AWSCredentialsProviderControllerService

Posted by ex...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit 31af82275e81d8f932a7346fee36857e8fcafcd9
Author: Joe Gresock <jg...@gmail.com>
AuthorDate: Fri Nov 11 05:07:07 2022 -0500

    NIFI-10791 Added AWS SDK v2 support to AWSCredentialsProviderControllerService
    
    This closes #6661
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../nifi-aws-abstract-processors/pom.xml           |   8 ++
 .../factory/CredentialPropertyDescriptors.java     |  29 ++++++
 .../nifi-aws-bundle/nifi-aws-processors/pom.xml    |   4 +
 .../provider/PropertiesCredentialsProvider.java    |  63 ++++++++++++
 .../factory/CredentialsProviderFactory.java        |  21 ++++
 .../provider/factory/CredentialsStrategy.java      |  20 +++-
 .../AbstractBooleanCredentialsStrategy.java        |  18 ++--
 .../strategies/AbstractCredentialsStrategy.java    |  42 ++++----
 .../AccessKeyPairCredentialsStrategy.java          |  28 ++++--
 .../strategies/AnonymousCredentialsStrategy.java   |  22 +++--
 .../strategies/AssumeRoleCredentialsStrategy.java  | 106 +++++++++++++++++----
 .../ExplicitDefaultCredentialsStrategy.java        |   9 +-
 .../strategies/FileCredentialsStrategy.java        |  22 +++--
 .../ImplicitDefaultCredentialsStrategy.java        |  15 ++-
 .../NamedProfileCredentialsStrategy.java           |  10 +-
 .../AWSCredentialsProviderControllerService.java   |  29 ++++--
 .../provider/factory/MockAWSProcessor.java         |   4 +-
 .../factory/TestCredentialsProviderFactory.java    |  54 ++++++++++-
 ...WSCredentialsProviderControllerServiceTest.java |  26 +++++
 .../nifi-aws-bundle/nifi-aws-service-api/pom.xml   |   4 +
 ...ice.java => AwsCredentialsProviderService.java} |  23 +++--
 .../service/AWSCredentialsProviderService.java     |   9 +-
 22 files changed, 454 insertions(+), 112 deletions(-)

diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml
index 173b8a5d94..da99b90d32 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml
@@ -48,6 +48,14 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>s3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>apache-client</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialPropertyDescriptors.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialPropertyDescriptors.java
index 707d39a60e..78e60f09b3 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialPropertyDescriptors.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialPropertyDescriptors.java
@@ -16,11 +16,16 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory;
 
+import org.apache.nifi.components.AllowableValue;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.components.resource.ResourceCardinality;
 import org.apache.nifi.components.resource.ResourceType;
 import org.apache.nifi.expression.ExpressionLanguageScope;
 import org.apache.nifi.processor.util.StandardValidators;
+import software.amazon.awssdk.regions.Region;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Shared definitions of properties that specify various AWS credentials.
@@ -194,4 +199,28 @@ public class CredentialPropertyDescriptors {
                     "this property to \"sts.cn-north-1.amazonaws.com.cn\" when you are requesting session credentials " +
                     "for services in China(Beijing) region or to \"sts.us-gov-west-1.amazonaws.com\" for GovCloud.")
             .build();
+
+    public static final PropertyDescriptor ASSUME_ROLE_REGION = new PropertyDescriptor.Builder()
+            .name("assume-role-sts-region")
+            .displayName("Region")
+            .description("The AWS Security Token Service (STS) region")
+            .dependsOn(ASSUME_ROLE_ARN)
+            .allowableValues(getAvailableRegions())
+            .defaultValue(createAllowableValue(Region.US_WEST_2).getValue())
+            .build();
+
+    public static AllowableValue createAllowableValue(final Region region) {
+        return new AllowableValue(region.id(), region.metadata().description(), "AWS Region Code : " + region.id());
+    }
+
+    public static AllowableValue[] getAvailableRegions() {
+        final List<AllowableValue> values = new ArrayList<>();
+        for (final Region region : Region.regions()) {
+            if (region.isGlobalRegion()) {
+                continue;
+            }
+            values.add(createAllowableValue(region));
+        }
+        return values.toArray(new AllowableValue[0]);
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
index d3c3b59077..49bc3aef24 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/pom.xml
@@ -74,6 +74,10 @@
             <groupId>com.amazonaws</groupId>
             <artifactId>aws-java-sdk-sts</artifactId>
         </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>sts</artifactId>
+        </dependency>
         <dependency>
             <groupId>commons-beanutils</groupId>
             <artifactId>commons-beanutils</artifactId>
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/PropertiesCredentialsProvider.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/PropertiesCredentialsProvider.java
new file mode 100644
index 0000000000..1e37392b7b
--- /dev/null
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/PropertiesCredentialsProvider.java
@@ -0,0 +1,63 @@
+/*
+ * 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.nifi.processors.aws.credentials.provider;
+
+
+import org.apache.nifi.processor.exception.ProcessException;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+public class PropertiesCredentialsProvider implements AwsCredentialsProvider {
+
+    private final String accessKey;
+    private final String secretAccessKey;
+
+    public PropertiesCredentialsProvider(final File credentialsProperties) {
+        try {
+            if (!credentialsProperties.exists()) {
+                throw new FileNotFoundException("File doesn't exist: " + credentialsProperties.getAbsolutePath());
+            }
+
+            try (final FileInputStream stream = new FileInputStream(credentialsProperties)) {
+                final Properties accountProperties = new Properties();
+                accountProperties.load(stream);
+
+                if (accountProperties.getProperty("accessKey") == null || accountProperties.getProperty("secretKey") == null) {
+                    throw new IllegalArgumentException(String.format("The specified file (%s) doesn't contain the expected properties " +
+                            "'accessKey' and 'secretKey'.", credentialsProperties.getAbsolutePath()));
+                }
+
+                accessKey = accountProperties.getProperty("accessKey");
+                secretAccessKey = accountProperties.getProperty("secretKey");
+            }
+        } catch (final IOException e) {
+            throw new ProcessException("Failed to load AWS credentials properties " + credentialsProperties, e);
+        }
+    }
+
+    @Override
+    public AwsCredentials resolveCredentials() {
+        return AwsBasicCredentials.create(accessKey, secretAccessKey);
+    }
+}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsProviderFactory.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsProviderFactory.java
index 94f041005c..545f3a283a 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsProviderFactory.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsProviderFactory.java
@@ -33,6 +33,7 @@ import org.apache.nifi.processors.aws.credentials.provider.factory.strategies.Im
 import org.apache.nifi.processors.aws.credentials.provider.factory.strategies.AssumeRoleCredentialsStrategy;
 
 import com.amazonaws.auth.AWSCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
 
 /**
@@ -122,4 +123,24 @@ public class CredentialsProviderFactory {
             return primaryCredentialsProvider;
         }
     }
+
+    /**
+     * Produces the AwsCredentialsProvider according to the given property set and the strategies configured in
+     * the factory.
+     * @return AwsCredentialsProvider implementation
+     */
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties);
+        final AwsCredentialsProvider primaryCredentialsProvider = primaryStrategy.getAwsCredentialsProvider(properties);
+        AwsCredentialsProvider derivedCredentialsProvider = null;
+
+        for (final CredentialsStrategy strategy : strategies) {
+            if (strategy.canCreateDerivedCredential(properties)) {
+                derivedCredentialsProvider = strategy.getDerivedAwsCredentialsProvider(properties, primaryCredentialsProvider);
+                break;
+            }
+        }
+
+        return derivedCredentialsProvider == null ? primaryCredentialsProvider : derivedCredentialsProvider;
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsStrategy.java
index d5d93a7277..05dc871ca4 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/CredentialsStrategy.java
@@ -16,14 +16,14 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory;
 
-import java.util.Collection;
-import java.util.Map;
-
+import com.amazonaws.auth.AWSCredentialsProvider;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.components.ValidationContext;
 import org.apache.nifi.components.ValidationResult;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
-import com.amazonaws.auth.AWSCredentialsProvider;
+import java.util.Collection;
+import java.util.Map;
 
 
 /**
@@ -72,4 +72,16 @@ public interface CredentialsStrategy {
     AWSCredentialsProvider getDerivedCredentialsProvider(Map<PropertyDescriptor, String> properties,
                                                          AWSCredentialsProvider primaryCredentialsProvider);
 
+    /**
+     * Creates an AwsCredentialsProvider instance for this strategy, given the properties defined by the user.
+     */
+    AwsCredentialsProvider getAwsCredentialsProvider(Map<PropertyDescriptor, String> properties);
+
+    /**
+     * Creates an AwsCredentialsProvider instance for this strategy, given the properties defined by the user and
+     * the AwsCredentialsProvider from the winning primary strategy.
+     */
+    AwsCredentialsProvider getDerivedAwsCredentialsProvider(Map<PropertyDescriptor, String> properties,
+                                                            AwsCredentialsProvider primaryCredentialsProvider);
+
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractBooleanCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractBooleanCredentialsStrategy.java
index 2c5b9a39db..4079d5a364 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractBooleanCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractBooleanCredentialsStrategy.java
@@ -34,7 +34,7 @@ public abstract class AbstractBooleanCredentialsStrategy extends AbstractCredent
 
     private PropertyDescriptor strategyProperty;
 
-    public AbstractBooleanCredentialsStrategy(String name, PropertyDescriptor strategyProperty) {
+    public AbstractBooleanCredentialsStrategy(final String name, final PropertyDescriptor strategyProperty) {
         super("Default Credentials", new PropertyDescriptor[]{
             strategyProperty
         });
@@ -42,21 +42,21 @@ public abstract class AbstractBooleanCredentialsStrategy extends AbstractCredent
     }
 
     @Override
-    public boolean canCreatePrimaryCredential(Map<PropertyDescriptor, String> properties) {
-        String useStrategyString = properties.get(strategyProperty);
-        Boolean useStrategy = Boolean.parseBoolean(useStrategyString);
+    public boolean canCreatePrimaryCredential(final Map<PropertyDescriptor, String> properties) {
+        final String useStrategyString = properties.get(strategyProperty);
+        final Boolean useStrategy = Boolean.parseBoolean(useStrategyString);
         return useStrategy;
     }
 
     @Override
     public Collection<ValidationResult> validate(final ValidationContext validationContext,
                                                  final CredentialsStrategy primaryStrategy) {
-        boolean thisIsSelectedStrategy = this == primaryStrategy;
-        Boolean useStrategy = validationContext.getProperty(strategyProperty).asBoolean();
+        final boolean thisIsSelectedStrategy = this == primaryStrategy;
+        final Boolean useStrategy = validationContext.getProperty(strategyProperty).asBoolean();
         if (!thisIsSelectedStrategy && useStrategy) {
-            String failureFormat = "property %1$s cannot be used with %2$s";
-            Collection<ValidationResult> validationFailureResults = new ArrayList<ValidationResult>();
-            String message = String.format(failureFormat, strategyProperty.getDisplayName(),
+            final String failureFormat = "property %1$s cannot be used with %2$s";
+            final Collection<ValidationResult> validationFailureResults = new ArrayList<ValidationResult>();
+            final String message = String.format(failureFormat, strategyProperty.getDisplayName(),
                     primaryStrategy.getName());
             validationFailureResults.add(new ValidationResult.Builder()
                     .subject(strategyProperty.getDisplayName())
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractCredentialsStrategy.java
index 29f1000318..5940bf28f2 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AbstractCredentialsStrategy.java
@@ -26,6 +26,7 @@ import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialsStrategy;
 
 import com.amazonaws.auth.AWSCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
 
 /**
@@ -35,17 +36,17 @@ public abstract class AbstractCredentialsStrategy implements CredentialsStrategy
     private final String name;
     private final PropertyDescriptor[] requiredProperties;
 
-    public AbstractCredentialsStrategy(String name, PropertyDescriptor[] requiredProperties) {
+    public AbstractCredentialsStrategy(final String name, PropertyDescriptor[] requiredProperties) {
         this.name = name;
         this.requiredProperties = requiredProperties;
     }
 
     @Override
-    public boolean canCreatePrimaryCredential(Map<PropertyDescriptor, String> properties) {
-        for (PropertyDescriptor requiredProperty : requiredProperties) {
-            boolean containsRequiredProperty = properties.containsKey(requiredProperty);
-            String propertyValue = properties.get(requiredProperty);
-            boolean containsValue = propertyValue != null;
+    public boolean canCreatePrimaryCredential(final Map<PropertyDescriptor, String> properties) {
+        for (final PropertyDescriptor requiredProperty : requiredProperties) {
+            final boolean containsRequiredProperty = properties.containsKey(requiredProperty);
+            final String propertyValue = properties.get(requiredProperty);
+            final boolean containsValue = propertyValue != null;
             if (!containsRequiredProperty || !containsValue) {
                 return false;
             }
@@ -56,19 +57,19 @@ public abstract class AbstractCredentialsStrategy implements CredentialsStrategy
     @Override
     public Collection<ValidationResult> validate(final ValidationContext validationContext,
                                                  final CredentialsStrategy primaryStrategy) {
-        boolean thisIsSelectedStrategy = this == primaryStrategy;
-        String requiredMessageFormat = "property %1$s must be set with %2$s";
-        String excludedMessageFormat = "property %1$s cannot be used with %2$s";
-        String failureFormat = thisIsSelectedStrategy ? requiredMessageFormat : excludedMessageFormat;
+        final boolean thisIsSelectedStrategy = this == primaryStrategy;
+        final String requiredMessageFormat = "property %1$s must be set with %2$s";
+        final String excludedMessageFormat = "property %1$s cannot be used with %2$s";
+        final String failureFormat = thisIsSelectedStrategy ? requiredMessageFormat : excludedMessageFormat;
         Collection<ValidationResult> validationFailureResults = null;
 
-        for (PropertyDescriptor requiredProperty : requiredProperties) {
-            boolean requiredPropertyIsSet = validationContext.getProperty(requiredProperty).isSet();
+        for (final PropertyDescriptor requiredProperty : requiredProperties) {
+            final boolean requiredPropertyIsSet = validationContext.getProperty(requiredProperty).isSet();
             if (requiredPropertyIsSet != thisIsSelectedStrategy) {
                 String message = String.format(failureFormat, requiredProperty.getDisplayName(),
                         primaryStrategy.getName());
                 if (validationFailureResults == null) {
-                    validationFailureResults = new ArrayList<ValidationResult>();
+                    validationFailureResults = new ArrayList<>();
                 }
                 validationFailureResults.add(new ValidationResult.Builder()
                         .subject(requiredProperty.getDisplayName())
@@ -80,7 +81,7 @@ public abstract class AbstractCredentialsStrategy implements CredentialsStrategy
         return validationFailureResults;
     }
 
-    public abstract AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties);
+    public abstract AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties);
 
     public String getName() {
         return name;
@@ -88,14 +89,19 @@ public abstract class AbstractCredentialsStrategy implements CredentialsStrategy
 
 
     @Override
-    public boolean canCreateDerivedCredential(Map<PropertyDescriptor, String> properties) {
+    public boolean canCreateDerivedCredential(final Map<PropertyDescriptor, String> properties) {
         return false;
     }
 
     @Override
-    public AWSCredentialsProvider getDerivedCredentialsProvider(Map<PropertyDescriptor, String> properties,
-                                                                AWSCredentialsProvider primaryCredentialsProvider) {
-        throw new UnsupportedOperationException();
+    public AWSCredentialsProvider getDerivedCredentialsProvider(final Map<PropertyDescriptor, String> properties,
+                                                                final AWSCredentialsProvider primaryCredentialsProvider) {
+        return null;
     }
 
+    @Override
+    public AwsCredentialsProvider getDerivedAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties,
+                                                                   final AwsCredentialsProvider primaryCredentialsProvider) {
+        return null;
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AccessKeyPairCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AccessKeyPairCredentialsStrategy.java
index 5cf8869276..16251dae5b 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AccessKeyPairCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AccessKeyPairCredentialsStrategy.java
@@ -16,14 +16,15 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory.strategies;
 
-import java.util.Map;
-
-import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
-
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.BasicAWSCredentials;
 import com.amazonaws.internal.StaticCredentialsProvider;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+
+import java.util.Map;
 
 
 /**
@@ -42,11 +43,18 @@ public class AccessKeyPairCredentialsStrategy extends AbstractCredentialsStrateg
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
-        String accessKey = properties.get(CredentialPropertyDescriptors.ACCESS_KEY);
-        String secretKey = properties.get(CredentialPropertyDescriptors.SECRET_KEY);
-        BasicAWSCredentials creds = new BasicAWSCredentials(accessKey, secretKey);
-        return new StaticCredentialsProvider(creds);
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String accessKey = properties.get(CredentialPropertyDescriptors.ACCESS_KEY);
+        final String secretKey = properties.get(CredentialPropertyDescriptors.SECRET_KEY);
+        final BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
+        return new StaticCredentialsProvider(credentials);
+    }
+
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String accessKey = properties.get(CredentialPropertyDescriptors.ACCESS_KEY);
+        final String secretKey = properties.get(CredentialPropertyDescriptors.SECRET_KEY);
+        return software.amazon.awssdk.auth.credentials.StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey));
     }
 
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AnonymousCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AnonymousCredentialsStrategy.java
index 4f8368ed14..416163d0ce 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AnonymousCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AnonymousCredentialsStrategy.java
@@ -16,14 +16,15 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory.strategies;
 
-import java.util.Map;
-
-import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
-
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.AnonymousAWSCredentials;
 import com.amazonaws.internal.StaticCredentialsProvider;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
+import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+
+import java.util.Map;
 
 
 /**
@@ -39,9 +40,14 @@ public class AnonymousCredentialsStrategy extends AbstractBooleanCredentialsStra
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
-        AnonymousAWSCredentials creds = new AnonymousAWSCredentials();
-        return new StaticCredentialsProvider(creds);
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        AnonymousAWSCredentials credentials = new AnonymousAWSCredentials();
+        return new StaticCredentialsProvider(credentials);
+    }
+
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        return AnonymousCredentialsProvider.create();
     }
 
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AssumeRoleCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AssumeRoleCredentialsStrategy.java
index 32439a9aee..5766332436 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AssumeRoleCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AssumeRoleCredentialsStrategy.java
@@ -16,27 +16,37 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory.strategies;
 
+import com.amazonaws.ClientConfiguration;
+import com.amazonaws.auth.AWSCredentialsProvider;
+import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider;
+import com.amazonaws.services.securitytoken.AWSSecurityTokenService;
+import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.ValidationContext;
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialsStrategy;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.sts.StsClient;
+import software.amazon.awssdk.services.sts.StsClientBuilder;
+import software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider;
+import software.amazon.awssdk.services.sts.model.AssumeRoleRequest;
+
+import java.net.URI;
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
 
-import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.components.ValidationContext;
-import org.apache.nifi.components.ValidationResult;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_ARN;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_EXTERNAL_ID;
-import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.MAX_SESSION_TIME;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_NAME;
-import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_HOST;
+import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_STS_ENDPOINT;
-import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialsStrategy;
-
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider;
-import com.amazonaws.services.securitytoken.AWSSecurityTokenService;
-import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient;
+import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.MAX_SESSION_TIME;
+import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_REGION;
 
 
 /**
@@ -57,12 +67,12 @@ public class AssumeRoleCredentialsStrategy extends AbstractCredentialsStrategy {
     }
 
     @Override
-    public boolean canCreatePrimaryCredential(Map<PropertyDescriptor, String> properties) {
+    public boolean canCreatePrimaryCredential(final Map<PropertyDescriptor, String> properties) {
         return false;
     }
 
     @Override
-    public boolean canCreateDerivedCredential(Map<PropertyDescriptor, String> properties) {
+    public boolean canCreateDerivedCredential(final Map<PropertyDescriptor, String> properties) {
         final String assumeRoleArn = properties.get(ASSUME_ROLE_ARN);
         final String assumeRoleName = properties.get(ASSUME_ROLE_NAME);
         if (assumeRoleArn != null && !assumeRoleArn.isEmpty()
@@ -72,7 +82,7 @@ public class AssumeRoleCredentialsStrategy extends AbstractCredentialsStrategy {
         return false;
     }
 
-    public boolean proxyVariablesValidForAssumeRole(Map<PropertyDescriptor, String> properties){
+    public boolean proxyVariablesValidForAssumeRole(final Map<PropertyDescriptor, String> properties){
         final String assumeRoleProxyHost = properties.get(ASSUME_ROLE_PROXY_HOST);
         final String assumeRoleProxyPort = properties.get(ASSUME_ROLE_PROXY_PORT);
         if (assumeRoleProxyHost != null && !assumeRoleProxyHost.isEmpty()
@@ -135,17 +145,17 @@ public class AssumeRoleCredentialsStrategy extends AbstractCredentialsStrategy {
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public AWSCredentialsProvider getDerivedCredentialsProvider(Map<PropertyDescriptor, String> properties,
-                                                                AWSCredentialsProvider primaryCredentialsProvider) {
+    public AWSCredentialsProvider getDerivedCredentialsProvider(final Map<PropertyDescriptor, String> properties,
+                                                                final AWSCredentialsProvider primaryCredentialsProvider) {
         final String assumeRoleArn = properties.get(ASSUME_ROLE_ARN);
         final String assumeRoleName = properties.get(ASSUME_ROLE_NAME);
         String rawMaxSessionTime = properties.get(MAX_SESSION_TIME);
-        rawMaxSessionTime = (rawMaxSessionTime != null) ? rawMaxSessionTime : MAX_SESSION_TIME.getDefaultValue();
+        rawMaxSessionTime = rawMaxSessionTime == null ? MAX_SESSION_TIME.getDefaultValue() : rawMaxSessionTime;
         final Integer maxSessionTime = Integer.parseInt(rawMaxSessionTime.trim());
         final String assumeRoleExternalId = properties.get(ASSUME_ROLE_EXTERNAL_ID);
         final String assumeRoleSTSEndpoint = properties.get(ASSUME_ROLE_STS_ENDPOINT);
@@ -177,4 +187,62 @@ public class AssumeRoleCredentialsStrategy extends AbstractCredentialsStrategy {
 
         return credsProvider;
     }
+
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public AwsCredentialsProvider getDerivedAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties,
+                                                                   AwsCredentialsProvider primaryCredentialsProvider) {
+        final String assumeRoleArn = properties.get(ASSUME_ROLE_ARN);
+        final String assumeRoleName = properties.get(ASSUME_ROLE_NAME);
+        String rawMaxSessionTime = properties.get(MAX_SESSION_TIME);
+        rawMaxSessionTime = rawMaxSessionTime == null ? MAX_SESSION_TIME.getDefaultValue() : rawMaxSessionTime;
+        final Integer maxSessionTime = Integer.parseInt(rawMaxSessionTime.trim());
+        final String assumeRoleExternalId = properties.get(ASSUME_ROLE_EXTERNAL_ID);
+        final String assumeRoleSTSEndpoint = properties.get(ASSUME_ROLE_STS_ENDPOINT);
+        final String stsRegion = properties.get(ASSUME_ROLE_REGION);
+
+        final StsAssumeRoleCredentialsProvider.Builder builder = StsAssumeRoleCredentialsProvider.builder();
+
+        // If proxy variables are set, then create Client Configuration with those values
+        final ApacheHttpClient.Builder httpClientBuilder = ApacheHttpClient.builder();
+        if (proxyVariablesValidForAssumeRole(properties)) {
+            final String assumeRoleProxyHost = properties.get(ASSUME_ROLE_PROXY_HOST);
+            final Integer assumeRoleProxyPort = Integer.parseInt(properties.get(ASSUME_ROLE_PROXY_PORT));
+            final software.amazon.awssdk.http.apache.ProxyConfiguration proxyConfig = software.amazon.awssdk.http.apache.ProxyConfiguration.builder()
+                    .endpoint(URI.create(String.format("%s:%s", assumeRoleProxyHost, assumeRoleProxyPort)))
+                    .build();
+            httpClientBuilder.proxyConfiguration(proxyConfig);
+        }
+
+        if (stsRegion == null) {
+            throw new IllegalStateException("Assume Role Region is required to interact with STS");
+        }
+
+        final StsClientBuilder stsClientBuilder = StsClient.builder()
+                .credentialsProvider(primaryCredentialsProvider)
+                .region(Region.of(stsRegion))
+                .httpClient(httpClientBuilder.build());
+        if (assumeRoleSTSEndpoint != null && !assumeRoleSTSEndpoint.isEmpty()) {
+            stsClientBuilder.endpointOverride(URI.create(assumeRoleSTSEndpoint));
+        }
+        final StsClient stsClient = stsClientBuilder.build();
+
+        final AssumeRoleRequest.Builder roleRequestBuilder = AssumeRoleRequest.builder()
+                .roleArn(assumeRoleArn)
+                .roleSessionName(assumeRoleName);
+
+        if (assumeRoleExternalId != null && !assumeRoleExternalId.isEmpty()) {
+            roleRequestBuilder.externalId(assumeRoleExternalId);
+        }
+
+        builder.refreshRequest(roleRequestBuilder.build())
+                .stsClient(stsClient)
+                .staleTime(Duration.ofSeconds(maxSessionTime));
+
+        return builder.build();
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ExplicitDefaultCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ExplicitDefaultCredentialsStrategy.java
index a8ac2e8605..03c2ba9a3f 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ExplicitDefaultCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ExplicitDefaultCredentialsStrategy.java
@@ -23,6 +23,8 @@ import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPro
 
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
 
 
 /**
@@ -39,8 +41,13 @@ public class ExplicitDefaultCredentialsStrategy extends AbstractBooleanCredentia
     }
 
         @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
       return new DefaultAWSCredentialsProviderChain();
     }
 
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        return DefaultCredentialsProvider.create();
+    }
+
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/FileCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/FileCredentialsStrategy.java
index 7fdf93b4d5..06bfec0139 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/FileCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/FileCredentialsStrategy.java
@@ -16,13 +16,15 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory.strategies;
 
-import java.util.Map;
-
+import com.amazonaws.auth.AWSCredentialsProvider;
+import com.amazonaws.auth.PropertiesFileCredentialsProvider;
 import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.processors.aws.credentials.provider.PropertiesCredentialsProvider;
 import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.PropertiesFileCredentialsProvider;
+import java.io.File;
+import java.util.Map;
 
 
 /**
@@ -45,9 +47,15 @@ public class FileCredentialsStrategy extends AbstractCredentialsStrategy {
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
-        String credsFile = properties.get(CredentialPropertyDescriptors.CREDENTIALS_FILE);
-        return new PropertiesFileCredentialsProvider(credsFile);
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String credentialsFile = properties.get(CredentialPropertyDescriptors.CREDENTIALS_FILE);
+        return new PropertiesFileCredentialsProvider(credentialsFile);
+    }
+
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String credentialsFile = properties.get(CredentialPropertyDescriptors.CREDENTIALS_FILE);
+        return new PropertiesCredentialsProvider(new File(credentialsFile));
     }
 
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ImplicitDefaultCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ImplicitDefaultCredentialsStrategy.java
index d9717b31d9..ab4e025f06 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ImplicitDefaultCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/ImplicitDefaultCredentialsStrategy.java
@@ -16,12 +16,13 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.factory.strategies;
 
-import java.util.Map;
-
-import org.apache.nifi.components.PropertyDescriptor;
-
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
+import org.apache.nifi.components.PropertyDescriptor;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+
+import java.util.Map;
 
 
 /**
@@ -36,8 +37,12 @@ public class ImplicitDefaultCredentialsStrategy extends AbstractCredentialsStrat
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
       return new DefaultAWSCredentialsProviderChain();
     }
 
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        return DefaultCredentialsProvider.create();
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/NamedProfileCredentialsStrategy.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/NamedProfileCredentialsStrategy.java
index 294f2ed073..8f9ff36fa4 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/NamedProfileCredentialsStrategy.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/NamedProfileCredentialsStrategy.java
@@ -23,6 +23,7 @@ import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPro
 
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.profile.ProfileCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
 
 /**
@@ -40,9 +41,14 @@ public class NamedProfileCredentialsStrategy extends AbstractCredentialsStrategy
     }
 
     @Override
-    public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) {
-        String profileName = properties.get(CredentialPropertyDescriptors.PROFILE_NAME);
+    public AWSCredentialsProvider getCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String profileName = properties.get(CredentialPropertyDescriptors.PROFILE_NAME);
         return new ProfileCredentialsProvider(profileName);
     }
 
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider(final Map<PropertyDescriptor, String> properties) {
+        final String profileName = properties.get(CredentialPropertyDescriptors.PROFILE_NAME);
+        return software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider.create(profileName);
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerService.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerService.java
index 476a41cf79..fa99e2cddc 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerService.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerService.java
@@ -16,13 +16,7 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.service;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import com.amazonaws.auth.AWSCredentialsProvider;
 import org.apache.nifi.annotation.behavior.Restricted;
 import org.apache.nifi.annotation.behavior.Restriction;
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
@@ -37,13 +31,19 @@ import org.apache.nifi.controller.ConfigurationContext;
 import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
 import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialsProviderFactory;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
-import com.amazonaws.auth.AWSCredentialsProvider;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ACCESS_KEY;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_EXTERNAL_ID;
-import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_HOST;
+import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_STS_ENDPOINT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.CREDENTIALS_FILE;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.PROFILE_NAME;
@@ -74,6 +74,7 @@ public class AWSCredentialsProviderControllerService extends AbstractControllerS
     public static final PropertyDescriptor ASSUME_ROLE_ARN = CredentialPropertyDescriptors.ASSUME_ROLE_ARN;
     public static final PropertyDescriptor ASSUME_ROLE_NAME = CredentialPropertyDescriptors.ASSUME_ROLE_NAME;
     public static final PropertyDescriptor MAX_SESSION_TIME = CredentialPropertyDescriptors.MAX_SESSION_TIME;
+    public static final PropertyDescriptor ASSUME_ROLE_REGION = CredentialPropertyDescriptors.ASSUME_ROLE_REGION;
 
     private static final List<PropertyDescriptor> properties;
 
@@ -92,10 +93,12 @@ public class AWSCredentialsProviderControllerService extends AbstractControllerS
         props.add(ASSUME_ROLE_PROXY_HOST);
         props.add(ASSUME_ROLE_PROXY_PORT);
         props.add(ASSUME_ROLE_STS_ENDPOINT);
+        props.add(ASSUME_ROLE_REGION);
         properties = Collections.unmodifiableList(props);
     }
 
     private volatile AWSCredentialsProvider credentialsProvider;
+    private volatile Map<PropertyDescriptor, String> evaluatedProperties;
     protected final CredentialsProviderFactory credentialsProviderFactory = new CredentialsProviderFactory();
 
     @Override
@@ -108,6 +111,12 @@ public class AWSCredentialsProviderControllerService extends AbstractControllerS
         return credentialsProvider;
     }
 
+    @Override
+    public AwsCredentialsProvider getAwsCredentialsProvider() {
+        // Avoiding instantiation until actually used, in case v1-related configuration is not compatible with v2 clients
+        return credentialsProviderFactory.getAwsCredentialsProvider(evaluatedProperties);
+    }
+
     @Override
     protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) {
         return credentialsProviderFactory.validate(validationContext);
@@ -115,7 +124,7 @@ public class AWSCredentialsProviderControllerService extends AbstractControllerS
 
     @OnEnabled
     public void onConfigured(final ConfigurationContext context) {
-        final Map<PropertyDescriptor, String> evaluatedProperties = new HashMap<>(context.getProperties());
+        evaluatedProperties = new HashMap<>(context.getProperties());
         evaluatedProperties.keySet().forEach(propertyDescriptor -> {
             if (propertyDescriptor.isExpressionLanguageSupported()) {
                 evaluatedProperties.put(propertyDescriptor,
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/MockAWSProcessor.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/MockAWSProcessor.java
index 700c99ad49..2f9ca8a733 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/MockAWSProcessor.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/MockAWSProcessor.java
@@ -36,6 +36,7 @@ import static org.apache.nifi.processors.aws.credentials.provider.factory.Creden
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_NAME;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_HOST;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT;
+import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_REGION;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.ASSUME_ROLE_STS_ENDPOINT;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.MAX_SESSION_TIME;
 import static org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors.PROFILE_NAME;
@@ -61,7 +62,8 @@ public class MockAWSProcessor extends AbstractAWSCredentialsProviderProcessor<Am
             ASSUME_ROLE_EXTERNAL_ID,
             ASSUME_ROLE_PROXY_HOST,
             ASSUME_ROLE_PROXY_PORT,
-            ASSUME_ROLE_STS_ENDPOINT
+            ASSUME_ROLE_STS_ENDPOINT,
+            ASSUME_ROLE_REGION
     );
 
     @Override
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/TestCredentialsProviderFactory.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/TestCredentialsProviderFactory.java
index 479dc66f36..fc07775b4e 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/TestCredentialsProviderFactory.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/factory/TestCredentialsProviderFactory.java
@@ -25,15 +25,22 @@ import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider;
 import com.amazonaws.auth.profile.ProfileCredentialsProvider;
 import com.amazonaws.internal.StaticCredentialsProvider;
 import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.processors.aws.credentials.provider.PropertiesCredentialsProvider;
 import org.apache.nifi.processors.aws.s3.FetchS3Object;
 import org.apache.nifi.util.TestRunner;
 import org.apache.nifi.util.TestRunners;
 import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider;
 
 import java.util.Map;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Tests of the validation and credentials provider capabilities of CredentialsProviderFactory.
@@ -51,6 +58,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(DefaultAWSCredentialsProviderChain.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(DefaultCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -65,6 +77,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(DefaultAWSCredentialsProviderChain.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(DefaultCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -89,6 +106,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(StaticCredentialsProvider.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(software.amazon.awssdk.auth.credentials.StaticCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -117,6 +139,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(PropertiesFileCredentialsProvider.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(PropertiesCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -127,12 +154,21 @@ public class TestCredentialsProviderFactory {
         runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_NAME, "BogusSession");
         runner.assertValid();
 
-        Map<PropertyDescriptor, String> properties = runner.getProcessContext().getProperties();
+        final Map<PropertyDescriptor, String> properties = runner.getProcessContext().getProperties();
         final CredentialsProviderFactory factory = new CredentialsProviderFactory();
         final AWSCredentialsProvider credentialsProvider = factory.getCredentialsProvider(properties);
         assertNotNull(credentialsProvider);
         assertEquals(STSAssumeRoleSessionCredentialsProvider.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        assertThrows(IllegalStateException.class, () -> factory.getAwsCredentialsProvider(properties));
+
+        runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
+        final Map<PropertyDescriptor, String> properties2 = runner.getProcessContext().getProperties();
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties2);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(StsAssumeRoleCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -181,6 +217,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         final AWSCredentials creds = credentialsProvider.getCredentials();
         assertEquals(AnonymousAWSCredentials.class, creds.getClass(), "credentials should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(AnonymousCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -204,6 +245,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(ProfileCredentialsProvider.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
@@ -212,6 +258,7 @@ public class TestCredentialsProviderFactory {
         runner.setProperty(CredentialPropertyDescriptors.CREDENTIALS_FILE, "src/test/resources/mock-aws-credentials.properties");
         runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_ARN, "BogusArn");
         runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_NAME, "BogusSession");
+        runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_REGION, Region.US_WEST_2.id());
         runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_HOST, "proxy.company.com");
         runner.setProperty(CredentialPropertyDescriptors.ASSUME_ROLE_PROXY_PORT, "8080");
         runner.assertValid();
@@ -222,6 +269,11 @@ public class TestCredentialsProviderFactory {
         assertNotNull(credentialsProvider);
         assertEquals(STSAssumeRoleSessionCredentialsProvider.class,
                 credentialsProvider.getClass(), "credentials provider should be equal");
+
+        final AwsCredentialsProvider credentialsProviderV2 = factory.getAwsCredentialsProvider(properties);
+        assertNotNull(credentialsProviderV2);
+        assertEquals(StsAssumeRoleCredentialsProvider.class,
+                credentialsProviderV2.getClass(), "credentials provider should be equal");
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerServiceTest.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerServiceTest.java
index f2a3e3459b..fd2dc183b9 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerServiceTest.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderControllerServiceTest.java
@@ -27,6 +27,9 @@ import org.apache.nifi.processors.aws.s3.FetchS3Object;
 import org.apache.nifi.util.TestRunner;
 import org.apache.nifi.util.TestRunners;
 import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -77,6 +80,7 @@ public class AWSCredentialsProviderControllerServiceTest {
         runner.addControllerService("awsCredentialsProvider", serviceImpl);
         runner.setProperty(serviceImpl, AbstractAWSProcessor.ACCESS_KEY, "awsAccessKey");
         runner.setProperty(serviceImpl, AbstractAWSProcessor.SECRET_KEY, "awsSecretKey");
+        runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_ARN, "Role");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_NAME, "RoleName");
         runner.enableControllerService(serviceImpl);
@@ -98,6 +102,7 @@ public class AWSCredentialsProviderControllerServiceTest {
         runner.addControllerService("awsCredentialsProvider", serviceImpl);
         runner.setProperty(serviceImpl, AbstractAWSProcessor.ACCESS_KEY, "awsAccessKey");
         runner.setProperty(serviceImpl, AbstractAWSProcessor.SECRET_KEY, "awsSecretKey");
+        runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_ARN, "Role");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_NAME, "RoleName");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.MAX_SESSION_TIME, "1000");
@@ -120,6 +125,7 @@ public class AWSCredentialsProviderControllerServiceTest {
         runner.addControllerService("awsCredentialsProvider", serviceImpl);
         runner.setProperty(serviceImpl, AbstractAWSProcessor.ACCESS_KEY, "awsAccessKey");
         runner.setProperty(serviceImpl, AbstractAWSProcessor.SECRET_KEY, "awsSecretKey");
+        runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_ARN, "Role");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_NAME, "RoleName");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.MAX_SESSION_TIME, "900");
@@ -135,6 +141,7 @@ public class AWSCredentialsProviderControllerServiceTest {
         runner.addControllerService("awsCredentialsProvider", serviceImpl);
         runner.setProperty(serviceImpl, AbstractAWSProcessor.ACCESS_KEY, "awsAccessKey");
         runner.setProperty(serviceImpl, AbstractAWSProcessor.SECRET_KEY, "awsSecretKey");
+        runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_ARN, "Role");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_NAME, "RoleName");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.MAX_SESSION_TIME, "900");
@@ -200,6 +207,7 @@ public class AWSCredentialsProviderControllerServiceTest {
         runner.addControllerService("awsCredentialsProvider", serviceImpl);
         runner.setProperty(serviceImpl, AbstractAWSProcessor.CREDENTIALS_FILE,
                 "src/test/resources/mock-aws-credentials.properties");
+        runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_REGION, Region.US_WEST_1.id());
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_ARN, "Role");
         runner.setProperty(serviceImpl, AWSCredentialsProviderControllerService.ASSUME_ROLE_NAME, "RoleName");
         runner.enableControllerService(serviceImpl);
@@ -322,4 +330,22 @@ public class AWSCredentialsProviderControllerServiceTest {
                 "awsSecretKey", service.getCredentialsProvider().getCredentials().getAWSSecretKey(),
                 "Expression language should be supported for " + CredentialPropertyDescriptors.SECRET_KEY.getName());
     }
+
+    @Test
+    public void testDefaultAWSCredentialsProviderChainV2() throws Throwable {
+        final TestRunner runner = TestRunners.newTestRunner(FetchS3Object.class);
+        final AWSCredentialsProviderControllerService serviceImpl = new AWSCredentialsProviderControllerService();
+        runner.addControllerService("awsCredentialsProvider", serviceImpl);
+
+        runner.enableControllerService(serviceImpl);
+
+        runner.assertValid(serviceImpl);
+        final AWSCredentialsProviderService service = (AWSCredentialsProviderService) runner.getProcessContext()
+                .getControllerServiceLookup().getControllerService("awsCredentialsProvider");
+        assertNotNull(service);
+        final AwsCredentialsProvider credentialsProvider = service.getAwsCredentialsProvider();
+        assertNotNull(credentialsProvider);
+        assertEquals(DefaultCredentialsProvider.class,
+                credentialsProvider.getClass(), "credentials provider should be equal");
+    }
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/pom.xml
index 941adc3bd4..aaf46c2f69 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/pom.xml
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/pom.xml
@@ -28,6 +28,10 @@
             <groupId>com.amazonaws</groupId>
             <artifactId>aws-java-sdk-core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>auth</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.amazonaws</groupId>
             <artifactId>aws-java-sdk-s3</artifactId>
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/AwsCredentialsProviderService.java
similarity index 58%
copy from nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java
copy to nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/AwsCredentialsProviderService.java
index 6b2e165859..27aec26f7e 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/AwsCredentialsProviderService.java
@@ -14,31 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.processors.aws.credentials.provider.service;
+package org.apache.nifi.processors.aws.credentials.provider;
 
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
 import org.apache.nifi.annotation.documentation.Tags;
 import org.apache.nifi.controller.ControllerService;
 import org.apache.nifi.processor.exception.ProcessException;
-
-import com.amazonaws.auth.AWSCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
 
 /**
- * AWSCredentialsProviderService interface to support getting AWSCredentialsProvider used for instantiating
- * aws clients
+ * AwsCredentialsProviderService interface to support getting AwsCredentialsProvider used for instantiating
+ * aws clients using the v2 SDK.
  *
- * @see <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
+ * @see <a href="https://sdk.amazonaws.com/java/api/2.0.0/software/amazon/awssdk/auth/credentials/AwsCredentialsProvider.html">AwsCredentialsProvider</a>
  */
-@Tags({"aws", "security", "credentials", "provider", "session"})
-@CapabilityDescription("Provides AWSCredentialsProvider.")
-public interface AWSCredentialsProviderService extends ControllerService {
+@Tags({"aws", "v2", "security", "credentials", "provider", "session"})
+@CapabilityDescription("Provides AwsCredentialsProvider.")
+public interface AwsCredentialsProviderService extends ControllerService {
 
     /**
-     * Get credentials provider
+     * Get credentials provider for Java SDK v2
      * @return credentials provider
      * @throws ProcessException process exception in case there is problem in getting credentials provider
      *
-     * @see  <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
+     * @see <a href="https://sdk.amazonaws.com/java/api/2.0.0/software/amazon/awssdk/auth/credentials/AwsCredentialsProvider.html">AwsCredentialsProvider</a>
      */
-    AWSCredentialsProvider getCredentialsProvider() throws ProcessException;
+    AwsCredentialsProvider getAwsCredentialsProvider();
 }
diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java
index 6b2e165859..c3d0b3e2de 100644
--- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java
+++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-service-api/src/main/java/org/apache/nifi/processors/aws/credentials/provider/service/AWSCredentialsProviderService.java
@@ -16,12 +16,11 @@
  */
 package org.apache.nifi.processors.aws.credentials.provider.service;
 
+import com.amazonaws.auth.AWSCredentialsProvider;
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
 import org.apache.nifi.annotation.documentation.Tags;
-import org.apache.nifi.controller.ControllerService;
 import org.apache.nifi.processor.exception.ProcessException;
-
-import com.amazonaws.auth.AWSCredentialsProvider;
+import org.apache.nifi.processors.aws.credentials.provider.AwsCredentialsProviderService;
 
 /**
  * AWSCredentialsProviderService interface to support getting AWSCredentialsProvider used for instantiating
@@ -31,10 +30,10 @@ import com.amazonaws.auth.AWSCredentialsProvider;
  */
 @Tags({"aws", "security", "credentials", "provider", "session"})
 @CapabilityDescription("Provides AWSCredentialsProvider.")
-public interface AWSCredentialsProviderService extends ControllerService {
+public interface AWSCredentialsProviderService extends AwsCredentialsProviderService {
 
     /**
-     * Get credentials provider
+     * Get credentials provider for Java SDK v1
      * @return credentials provider
      * @throws ProcessException process exception in case there is problem in getting credentials provider
      *