hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject [hadoop] branch trunk updated: YARN-9470. Fix order of actual and expected expression in assert statements
Date Thu, 18 Apr 2019 06:46:28 GMT
This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new aa4c744  YARN-9470. Fix order of actual and expected expression in assert statements
aa4c744 is described below

commit aa4c744aef7f2536f9054bf1692a2c693d862364
Author: Prabhu Joseph <pjoseph@cloudera.com>
AuthorDate: Wed Apr 17 21:48:19 2019 +0530

    YARN-9470. Fix order of actual and expected expression in assert statements
    
    Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
---
 .../hadoop-yarn-services-core/pom.xml              |  6 ++
 .../yarn/service/TestYarnNativeServices.java       |  3 +-
 .../hadoop/yarn/service/client/TestServiceCLI.java | 13 ++--
 .../yarn/service/utils/TestServiceApiUtil.java     |  3 +-
 .../hadoop-yarn/hadoop-yarn-client/pom.xml         |  5 ++
 .../client/api/async/impl/TestAMRMClientAsync.java |  3 +-
 .../hadoop/yarn/client/api/impl/TestAHSClient.java |  3 +-
 .../yarn/client/api/impl/TestAHSv2ClientImpl.java  | 34 +++++-----
 .../yarn/client/api/impl/TestAMRMClient.java       |  3 +-
 .../TestOpportunisticContainerAllocationE2E.java   |  3 +-
 .../yarn/client/api/impl/TestYarnClient.java       | 39 +++++------
 .../api/impl/TestYarnClientWithReservation.java    | 10 +--
 .../apache/hadoop/yarn/client/cli/TestYarnCLI.java | 13 ++--
 .../hadoop-yarn/hadoop-yarn-common/pom.xml         |  5 ++
 .../apache/hadoop/yarn/api/TestResourcePBImpl.java |  3 +-
 .../TestLogAggregationIndexFileController.java     |  7 +-
 .../java/org/apache/hadoop/yarn/util/TestApps.java |  3 +-
 .../hadoop/yarn/util/TestConverterUtils.java       |  9 +--
 .../yarn/util/TestTimelineServiceHelper.java       |  4 +-
 .../yarn/util/resource/TestResourceUtils.java      | 28 ++++----
 .../hadoop-yarn/hadoop-yarn-csi/pom.xml            |  5 ++
 .../yarn/csi/adaptor/TestCsiAdaptorService.java    | 13 ++--
 .../pom.xml                                        |  5 ++
 .../webapp/TestAHSWebServices.java                 | 19 +++---
 .../hadoop-yarn-server-common/pom.xml              |  5 ++
 .../policies/manager/BasePolicyManagerTest.java    |  9 +--
 .../hadoop-yarn-server-nodemanager/pom.xml         |  5 ++
 .../TestLinuxContainerExecutorWithMocks.java       | 46 ++++++-------
 .../TestContainerManagerRecovery.java              | 13 ++--
 .../launcher/TestContainerLaunch.java              | 21 +++---
 .../linux/resources/TestResourceHandlerModule.java |  6 +-
 .../localizer/TestResourceLocalizationService.java |  9 +--
 .../logaggregation/TestLogAggregationService.java  |  3 +-
 .../nvidia/TestNvidiaGPUPluginForRuntimeV2.java    | 31 ++++-----
 .../recovery/TestNMLeveldbStateStoreService.java   | 32 ++++-----
 .../nodemanager/webapp/TestNMWebServices.java      |  9 +--
 .../hadoop-yarn-server-resourcemanager/pom.xml     |  5 ++
 .../resourcemanager/TestClientRMService.java       | 23 +++----
 .../TestKillApplicationWithRMHA.java               |  3 +-
 .../server/resourcemanager/TestRMAdminService.java |  3 +-
 .../yarn/server/resourcemanager/TestRMHA.java      |  5 +-
 .../yarn/server/resourcemanager/TestRMRestart.java |  5 +-
 .../server/resourcemanager/TestRMServerUtils.java  |  9 +--
 .../TestWorkPreservingRMRestart.java               | 16 +++--
 .../metrics/TestSystemMetricsPublisher.java        |  3 +-
 ...alCapacityPreemptionPolicyPreemptToBalance.java |  4 +-
 .../TestFileSystemNodeAttributeStore.java          | 13 ++--
 .../nodelabels/TestRMNodeLabelsManager.java        | 76 +++++++++++-----------
 .../recovery/TestFSRMStateStore.java               |  5 +-
 .../recovery/TestZKRMStateStore.java               |  7 +-
 .../reservation/TestReservationSystemUtil.java     |  9 +--
 .../reservation/planning/TestAlignedPlanner.java   | 33 ++++++----
 .../rmapp/TestRMAppTransitions.java                |  4 +-
 .../scheduler/capacity/TestApplicationLimits.java  | 26 ++++----
 .../capacity/TestApplicationPriority.java          |  8 +--
 .../scheduler/capacity/TestCapacityScheduler.java  |  4 +-
 .../scheduler/fair/TestConfigurableResource.java   | 13 ++--
 .../scheduler/fair/TestContinuousScheduling.java   |  8 ++-
 .../scheduler/fair/TestFSLeafQueue.java            | 10 +--
 .../scheduler/fair/TestFairScheduler.java          | 32 ++++-----
 .../scheduler/fifo/TestFifoScheduler.java          | 15 +++--
 .../scheduler/policy/TestFifoOrderingPolicy.java   | 10 +--
 .../TestFifoOrderingPolicyForPendingApps.java      |  8 ++-
 .../volume/csi/TestVolumeProcessor.java            |  9 +--
 .../webapp/TestRMWebServicesNodes.java             |  5 +-
 .../webapp/TestRMWebServicesReservation.java       |  3 +-
 .../pom.xml                                        |  5 ++
 .../timeline/TestEntityGroupFSTimelineStore.java   |  3 +-
 .../pom.xml                                        |  6 ++
 .../flow/TestHBaseStorageFlowRunCompaction.java    |  4 +-
 .../hadoop-yarn-server-timelineservice/pom.xml     |  6 ++
 .../collector/TestTimelineCollector.java           |  5 +-
 .../hadoop-yarn-server-web-proxy/pom.xml           |  5 ++
 .../server/webproxy/TestWebAppProxyServlet.java    |  3 +-
 .../server/webproxy/amfilter/TestAmFilter.java     |  3 +-
 .../webproxy/amfilter/TestSecureAmFilter.java      |  4 +-
 76 files changed, 501 insertions(+), 345 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml
index 695d93b..ff585f9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml
@@ -250,6 +250,12 @@
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
   </dependencies>
 
 </project>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
index 6c38511..0512e58 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
@@ -61,6 +61,7 @@ import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.TimeoutException;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.api.records.YarnApplicationState.FINISHED;
 import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.*;
 import static org.apache.hadoop.yarn.service.exceptions.LauncherExitCodes.EXIT_COMMAND_ARGUMENT_ERROR;
@@ -904,7 +905,7 @@ public class TestYarnNativeServices extends ServiceTestUtils {
 
     int i = 0;
     for (String s : instances) {
-      Assert.assertEquals(component.getName() + "-" + i, s);
+      assertThat(s).isEqualTo(component.getName() + "-" + i);
       i++;
     }
   }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java
index 41be8c7..f75c0af 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java
@@ -50,6 +50,7 @@ import java.io.PrintStream;
 import java.util.Arrays;
 import java.util.List;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.client.api.AppAdminClient.YARN_APP_ADMIN_CLIENT_PREFIX;
 import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.DEPENDENCY_TARBALL_PATH;
 import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.YARN_SERVICE_BASE_PATH;
@@ -172,7 +173,7 @@ public class TestServiceCLI {
         "-initiate", ExampleAppJson.resourceName(ExampleAppJson.APP_JSON),
         "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test (timeout = 180000)
@@ -182,7 +183,7 @@ public class TestServiceCLI {
         "-autoFinalize",
         "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test
@@ -194,7 +195,7 @@ public class TestServiceCLI {
         "-instances", "comp1-0,comp1-1",
         "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test
@@ -206,7 +207,7 @@ public class TestServiceCLI {
         "-components", "comp1,comp2",
         "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test
@@ -218,7 +219,7 @@ public class TestServiceCLI {
         "-components", "comp1,comp2",
         "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test
@@ -229,7 +230,7 @@ public class TestServiceCLI {
     String[] args = {"app", "-upgrade", "app-1",
         "-cancel", "-appTypes", DUMMY_APP_TYPE};
     int result = cli.run(ApplicationCLI.preProcessArgs(args));
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
   }
 
   @Test (timeout = 180000)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
index 2bf59b8..3c9b524 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
@@ -45,6 +45,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.service.conf.RestApiConstants.DEFAULT_UNLIMITED_LIFETIME;
 import static org.apache.hadoop.yarn.service.exceptions.RestApiErrorMessages.*;
 import static org.junit.Assert.assertEquals;
@@ -268,7 +269,7 @@ public class TestServiceApiUtil extends ServiceTestUtils {
       Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage());
     }
 
-    assertEquals(app.getLifetime(), DEFAULT_UNLIMITED_LIFETIME);
+    assertThat(app.getLifetime()).isEqualTo(DEFAULT_UNLIMITED_LIFETIME);
   }
 
   private static Resource createValidResource() {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
index 5de2cb4..81ff752 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/pom.xml
@@ -84,6 +84,11 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
     <dependency>
   		<groupId>org.apache.hadoop</groupId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java
index f56747e..3cd4414 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.client.api.async.impl;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyFloat;
 import static org.mockito.ArgumentMatchers.anyInt;
@@ -596,7 +597,7 @@ public class TestAMRMClientAsync {
 
     @Override
     public void onError(Throwable e) {
-      Assert.assertEquals(e.getMessage(), "Exception from callback handler");
+      assertThat(e).hasMessage("Exception from callback handler");
       callStopAndNotify();
     }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSClient.java
index 3dbd1dd..dcb8a17 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSClient.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.client.api.impl;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -84,7 +85,7 @@ public class TestAHSClient {
     Assert.assertEquals(reports, expectedReports);
 
     reports = client.getApplications();
-    Assert.assertEquals(reports.size(), 4);
+    assertThat(reports).hasSize(4);
     client.stop();
   }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSv2ClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSv2ClientImpl.java
index 1e0a1d6..f4d7a56 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSv2ClientImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAHSv2ClientImpl.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.client.api.impl;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -80,14 +81,14 @@ public class TestAHSv2ClientImpl {
     when(spyTimelineReaderClient.getApplicationEntity(appId, "ALL", null))
         .thenReturn(createApplicationTimelineEntity(appId, true, false));
     ContainerReport report = client.getContainerReport(containerId);
-    Assert.assertEquals(report.getContainerId(), containerId);
-    Assert.assertEquals(report.getAssignedNode().getHost(), "test host");
-    Assert.assertEquals(report.getAssignedNode().getPort(), 100);
-    Assert.assertEquals(report.getAllocatedResource().getVirtualCores(), 8);
-    Assert.assertEquals(report.getCreationTime(), 123456);
-    Assert.assertEquals(report.getLogUrl(),
-        "https://localhost:8188/ahs/logs/test host:100/"
-            + "container_0_0001_01_000001/container_0_0001_01_000001/user1");
+    assertThat(report.getContainerId()).isEqualTo(containerId);
+    assertThat(report.getAssignedNode().getHost()).isEqualTo("test host");
+    assertThat(report.getAssignedNode().getPort()).isEqualTo(100);
+    assertThat(report.getAllocatedResource().getVirtualCores()).isEqualTo(8);
+    assertThat(report.getCreationTime()).isEqualTo(123456);
+    assertThat(report.getLogUrl()).isEqualTo("https://localhost:8188/ahs/logs/"
+        + "test host:100/container_0_0001_01_000001/"
+        + "container_0_0001_01_000001/user1");
   }
 
   @Test
@@ -100,10 +101,10 @@ public class TestAHSv2ClientImpl {
         .thenReturn(createAppAttemptTimelineEntity(appAttemptId));
     ApplicationAttemptReport report =
         client.getApplicationAttemptReport(appAttemptId);
-    Assert.assertEquals(report.getApplicationAttemptId(), appAttemptId);
-    Assert.assertEquals(report.getFinishTime(), Integer.MAX_VALUE + 2L);
-    Assert.assertEquals(report.getOriginalTrackingUrl(),
-        "test original tracking url");
+    assertThat(report.getApplicationAttemptId()).isEqualTo(appAttemptId);
+    assertThat(report.getFinishTime()).isEqualTo(Integer.MAX_VALUE + 2L);
+    assertThat(report.getOriginalTrackingUrl()).
+        isEqualTo("test original tracking url");
   }
 
   @Test
@@ -112,11 +113,12 @@ public class TestAHSv2ClientImpl {
     when(spyTimelineReaderClient.getApplicationEntity(appId, "ALL", null))
         .thenReturn(createApplicationTimelineEntity(appId, false, false));
     ApplicationReport report = client.getApplicationReport(appId);
-    Assert.assertEquals(report.getApplicationId(), appId);
-    Assert.assertEquals(report.getAppNodeLabelExpression(), "test_node_label");
+    assertThat(report.getApplicationId()).isEqualTo(appId);
+    assertThat(report.getAppNodeLabelExpression()).
+        isEqualTo("test_node_label");
     Assert.assertTrue(report.getApplicationTags().contains("Test_APP_TAGS_1"));
-    Assert.assertEquals(report.getYarnApplicationState(),
-        YarnApplicationState.FINISHED);
+    assertThat(report.getYarnApplicationState()).
+        isEqualTo(YarnApplicationState.FINISHED);
   }
 
   private static TimelineEntity createApplicationTimelineEntity(
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
index da4f6ee..24666f0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.client.api.impl;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -1616,7 +1617,7 @@ public class TestAMRMClient extends BaseAMRMClientTest{
         for(ContainerStatus cStatus :allocResponse
             .getCompletedContainersStatuses()) {
           if(releases.contains(cStatus.getContainerId())) {
-            assertEquals(cStatus.getState(), ContainerState.COMPLETE);
+            assertThat(cStatus.getState()).isEqualTo(ContainerState.COMPLETE);
             assertEquals(-100, cStatus.getExitStatus());
             releases.remove(cStatus.getContainerId());
           }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestOpportunisticContainerAllocationE2E.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestOpportunisticContainerAllocationE2E.java
index 753c00b..870862b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestOpportunisticContainerAllocationE2E.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestOpportunisticContainerAllocationE2E.java
@@ -81,6 +81,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -657,7 +658,7 @@ public class TestOpportunisticContainerAllocationE2E {
         for (ContainerStatus cStatus : allocResponse
             .getCompletedContainersStatuses()) {
           if (releases.contains(cStatus.getContainerId())) {
-            assertEquals(cStatus.getState(), ContainerState.COMPLETE);
+            assertThat(cStatus.getState()).isEqualTo(ContainerState.COMPLETE);
             assertEquals(-100, cStatus.getExitStatus());
             releases.remove(cStatus.getContainerId());
           }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
index 3848b10..4af97e4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
@@ -93,6 +93,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
@@ -416,7 +417,7 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     List<ApplicationReport> expectedReports = ((MockYarnClient)client).getReports();
 
     List<ApplicationReport>  reports = client.getApplications();
-    Assert.assertEquals(reports, expectedReports);
+    assertThat(reports).isEqualTo(expectedReports);
 
     Set<String> appTypes = new HashSet<>();
     appTypes.add("YARN");
@@ -424,7 +425,7 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
 
     reports =
         client.getApplications(appTypes, null);
-    Assert.assertEquals(reports.size(), 2);
+    assertThat(reports).hasSize(2);
     Assert
         .assertTrue((reports.get(0).getApplicationType().equals("YARN") && reports
             .get(1).getApplicationType().equals("NON-YARN"))
@@ -439,7 +440,7 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     appStates.add(YarnApplicationState.FINISHED);
     appStates.add(YarnApplicationState.FAILED);
     reports = client.getApplications(null, appStates);
-    Assert.assertEquals(reports.size(), 2);
+    assertThat(reports).hasSize(2);
     Assert
     .assertTrue((reports.get(0).getApplicationType().equals("NON-YARN") && reports
         .get(1).getApplicationType().equals("NON-MAPREDUCE"))
@@ -469,9 +470,9 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     List<ApplicationAttemptReport> reports = client
         .getApplicationAttempts(applicationId);
     Assert.assertNotNull(reports);
-    Assert.assertEquals(reports.get(0).getApplicationAttemptId(),
+    assertThat(reports.get(0).getApplicationAttemptId()).isEqualTo(
         ApplicationAttemptId.newInstance(applicationId, 1));
-    Assert.assertEquals(reports.get(1).getApplicationAttemptId(),
+    assertThat(reports.get(1).getApplicationAttemptId()).isEqualTo(
         ApplicationAttemptId.newInstance(applicationId, 2));
     client.stop();
   }
@@ -492,7 +493,7 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     ApplicationAttemptReport report = client
         .getApplicationAttemptReport(appAttemptId);
     Assert.assertNotNull(report);
-    Assert.assertEquals(report.getApplicationAttemptId().toString(),
+    assertThat(report.getApplicationAttemptId().toString()).isEqualTo(
         expectedReports.get(0).getCurrentApplicationAttemptId().toString());
     client.stop();
   }
@@ -512,11 +513,11 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
         applicationId, 1);
     List<ContainerReport> reports = client.getContainers(appAttemptId);
     Assert.assertNotNull(reports);
-    Assert.assertEquals(reports.get(0).getContainerId(),
+    assertThat(reports.get(0).getContainerId()).isEqualTo(
         (ContainerId.newContainerId(appAttemptId, 1)));
-    Assert.assertEquals(reports.get(1).getContainerId(),
+    assertThat(reports.get(1).getContainerId()).isEqualTo(
         (ContainerId.newContainerId(appAttemptId, 2)));
-    Assert.assertEquals(reports.get(2).getContainerId(),
+    assertThat(reports.get(2).getContainerId()).isEqualTo(
         (ContainerId.newContainerId(appAttemptId, 3)));
     
     //First2 containers should come from RM with updated state information and 
@@ -554,9 +555,9 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     List<ContainerReport> reports = client.getContainers(appAttemptId);
     Assert.assertNotNull(reports);
     Assert.assertTrue(reports.size() == 2);
-    Assert.assertEquals(reports.get(0).getContainerId(),
+    assertThat(reports.get(0).getContainerId()).isEqualTo(
         (ContainerId.newContainerId(appAttemptId, 1)));
-    Assert.assertEquals(reports.get(1).getContainerId(),
+    assertThat(reports.get(1).getContainerId()).isEqualTo(
         (ContainerId.newContainerId(appAttemptId, 2)));
 
     //Only 2 running containers from RM are present when AHS throws exception
@@ -586,13 +587,13 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     ContainerId containerId = ContainerId.newContainerId(appAttemptId, 1);
     ContainerReport report = client.getContainerReport(containerId);
     Assert.assertNotNull(report);
-    Assert.assertEquals(report.getContainerId().toString(),
+    assertThat(report.getContainerId().toString()).isEqualTo(
         (ContainerId.newContainerId(expectedReports.get(0)
             .getCurrentApplicationAttemptId(), 1)).toString());
     containerId = ContainerId.newContainerId(appAttemptId, 3);
     report = client.getContainerReport(containerId);
     Assert.assertNotNull(report);
-    Assert.assertEquals(report.getContainerId().toString(),
+    assertThat(report.getContainerId().toString()).isEqualTo(
         (ContainerId.newContainerId(expectedReports.get(0)
             .getCurrentApplicationAttemptId(), 3)).toString());
     Assert.assertNotNull(report.getExecutionType());
@@ -609,16 +610,16 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     Map<String, Set<NodeId>> expectedLabelsToNodes =
         ((MockYarnClient)client).getLabelsToNodesMap();
     Map<String, Set<NodeId>> labelsToNodes = client.getLabelsToNodes();
-    Assert.assertEquals(labelsToNodes, expectedLabelsToNodes);
-    Assert.assertEquals(labelsToNodes.size(), 3);
+    assertThat(labelsToNodes).isEqualTo(expectedLabelsToNodes);
+    assertThat(labelsToNodes).hasSize(3);
 
     // Get labels to nodes for selected labels
     Set<String> setLabels = new HashSet<>(Arrays.asList("x", "z"));
     expectedLabelsToNodes =
         ((MockYarnClient)client).getLabelsToNodesMap(setLabels);
     labelsToNodes = client.getLabelsToNodes(setLabels);
-    Assert.assertEquals(labelsToNodes, expectedLabelsToNodes);
-    Assert.assertEquals(labelsToNodes.size(), 2);
+    assertThat(labelsToNodes).isEqualTo(expectedLabelsToNodes);
+    assertThat(labelsToNodes).hasSize(2);
 
     client.stop();
     client.close();
@@ -634,8 +635,8 @@ public class TestYarnClient extends ParameterizedSchedulerTestBase {
     Map<NodeId, Set<String>> expectedNodesToLabels = ((MockYarnClient) client)
         .getNodeToLabelsMap();
     Map<NodeId, Set<String>> nodesToLabels = client.getNodeToLabels();
-    Assert.assertEquals(nodesToLabels, expectedNodesToLabels);
-    Assert.assertEquals(nodesToLabels.size(), 1);
+    assertThat(nodesToLabels).isEqualTo(expectedNodesToLabels);
+    assertThat(nodesToLabels).hasSize(1);
 
     client.stop();
     client.close();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClientWithReservation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClientWithReservation.java
index 0836b7b..7176477 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClientWithReservation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClientWithReservation.java
@@ -62,6 +62,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.stream.Collectors;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 
 /**
  * This class is to test class {@link YarnClient) and {@link YarnClientImpl}
@@ -432,7 +434,7 @@ public class TestYarnClientWithReservation {
 
       // Ensure all reservations are filtered out.
       Assert.assertNotNull(response);
-      Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+      assertThat(response.getReservationAllocationState()).isEmpty();
 
       duration = 30000;
       deadline = sRequest.getReservationDefinition().getDeadline();
@@ -447,7 +449,7 @@ public class TestYarnClientWithReservation {
 
       // Ensure all reservations are filtered out.
       Assert.assertNotNull(response);
-      Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+      assertThat(response.getReservationAllocationState()).isEmpty();
 
       arrival = clock.getTime();
       // List reservations, search by end time before the reservation start
@@ -460,7 +462,7 @@ public class TestYarnClientWithReservation {
 
       // Ensure all reservations are filtered out.
       Assert.assertNotNull(response);
-      Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+      assertThat(response.getReservationAllocationState()).isEmpty();
 
       // List reservations, search by very small end time.
       request = ReservationListRequest
@@ -470,7 +472,7 @@ public class TestYarnClientWithReservation {
 
       // Ensure all reservations are filtered out.
       Assert.assertNotNull(response);
-      Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+      assertThat(response.getReservationAllocationState()).isEmpty();
 
     } finally {
       // clean-up
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
index 17d570f..939ae46 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java
@@ -19,6 +19,7 @@ package org.apache.hadoop.yarn.client.cli;
 
 import org.apache.hadoop.yarn.api.records.NodeAttribute;
 import org.apache.hadoop.yarn.api.records.NodeAttributeType;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
@@ -1685,26 +1686,26 @@ public class TestYarnCLI {
   public void testMissingArguments() throws Exception {
     ApplicationCLI cli = createAndGetAppCLI();
     int result = cli.run(new String[] { "application", "-status" });
-    Assert.assertEquals(result, -1);
+    assertThat(result).isEqualTo(-1);
     Assert.assertEquals(String.format("Missing argument for options%n%1s",
         createApplicationCLIHelpMessage()), sysOutStream.toString());
 
     sysOutStream.reset();
     result = cli.run(new String[] { "applicationattempt", "-status" });
-    Assert.assertEquals(result, -1);
+    assertThat(result).isEqualTo(-1);
     Assert.assertEquals(String.format("Missing argument for options%n%1s",
         createApplicationAttemptCLIHelpMessage()), sysOutStream.toString());
 
     sysOutStream.reset();
     result = cli.run(new String[] { "container", "-status" });
-    Assert.assertEquals(result, -1);
+    assertThat(result).isEqualTo(-1);
     Assert.assertEquals(String.format("Missing argument for options %1s",
         createContainerCLIHelpMessage()), normalize(sysOutStream.toString()));
 
     sysOutStream.reset();
     NodeCLI nodeCLI = createAndGetNodeCLI();
     result = nodeCLI.run(new String[] { "-status" });
-    Assert.assertEquals(result, -1);
+    assertThat(result).isEqualTo(-1);
     Assert.assertEquals(String.format("Missing argument for options%n%1s",
         createNodeCLIHelpMessage()), sysOutStream.toString());
   }
@@ -2017,7 +2018,7 @@ public class TestYarnCLI {
         cli.run(new String[] { "application", "-appId",
             applicationId.toString(),
         "-updatePriority", "1" });
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
     verify(client).updateApplicationPriority(any(ApplicationId.class),
         any(Priority.class));
 
@@ -2413,7 +2414,7 @@ public class TestYarnCLI {
 
     int result = cli.run(new String[] { "application", "-appId",
         applicationId.toString(), "-updateLifetime", "10" });
-    Assert.assertEquals(result, 0);
+    assertThat(result).isEqualTo(0);
     verify(client)
         .updateApplicationTimeouts(any(UpdateApplicationTimeoutsRequest.class));
   }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
index 14efd2a..c28c297 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
@@ -114,6 +114,11 @@
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
     <dependency>
       <groupId>org.apache.hadoop</groupId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/api/TestResourcePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/api/TestResourcePBImpl.java
index f9d296d..c92e73f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/api/TestResourcePBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/api/TestResourcePBImpl.java
@@ -34,6 +34,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -294,7 +295,7 @@ public class TestResourcePBImpl {
         ResourceUtils.getResourceTypes().get("resource3");
     Assert.assertTrue(info.getAttributes().isEmpty());
     Assert.assertFalse(info.getTags().isEmpty());
-    Assert.assertEquals(info.getTags().size(), 2);
+    assertThat(info.getTags()).hasSize(2);
     info.getTags().remove("resource3_tag_1");
     info.getTags().remove("resource3_tag_2");
     Assert.assertTrue(info.getTags().isEmpty());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java
index 7922679..64e0b20 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.logaggregation.filecontroller.ifile;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.mock;
@@ -288,7 +289,7 @@ public class TestLogAggregationIndexFileController {
     // We can only get the logs/logmeta from the first write.
     meta = fileFormat.readAggregatedLogsMeta(
         logRequest);
-    Assert.assertEquals(meta.size(), 1);
+    assertThat(meta.size()).isEqualTo(1);
     for (ContainerLogMeta log : meta) {
       Assert.assertTrue(log.getContainerId().equals(containerId.toString()));
       Assert.assertTrue(log.getNodeId().equals(nodeId.toString()));
@@ -319,7 +320,7 @@ public class TestLogAggregationIndexFileController {
     fileFormat.closeWriter();
     meta = fileFormat.readAggregatedLogsMeta(
             logRequest);
-    Assert.assertEquals(meta.size(), 2);
+    assertThat(meta.size()).isEqualTo(2);
     for (ContainerLogMeta log : meta) {
       Assert.assertTrue(log.getContainerId().equals(containerId.toString()));
       Assert.assertTrue(log.getNodeId().equals(nodeId.toString()));
@@ -347,7 +348,7 @@ public class TestLogAggregationIndexFileController {
     Assert.assertTrue(status.length == 2);
     meta = fileFormat.readAggregatedLogsMeta(
         logRequest);
-    Assert.assertEquals(meta.size(), 3);
+    assertThat(meta.size()).isEqualTo(3);
     for (ContainerLogMeta log : meta) {
       Assert.assertTrue(log.getContainerId().equals(containerId.toString()));
       Assert.assertTrue(log.getNodeId().equals(nodeId.toString()));
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestApps.java
index 0d65d65..5db8046 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestApps.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestApps.java
@@ -25,6 +25,7 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -52,7 +53,7 @@ public class TestApps {
     String badEnv = "1,,2=a=b,3=a=,4==,5==a,==,c-3=3,=";
     environment.clear();
     Apps.setEnvFromInputString(environment, badEnv, File.pathSeparator);
-    assertEquals(environment.size(), 0);
+    assertThat(environment).isEmpty();
 
     // Test "=" in the value part
     environment.clear();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestConverterUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestConverterUtils.java
index 077558b..5754221 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestConverterUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestConverterUtils.java
@@ -17,6 +17,7 @@
 */
 package org.apache.hadoop.yarn.util;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
@@ -93,12 +94,12 @@ public class TestConverterUtils {
     NodeId nid;
     
     nid = ConverterUtils.toNodeIdWithDefaultPort("node:10");
-    assertEquals(nid.getPort(), 10);
-    assertEquals(nid.getHost(), "node");
+    assertThat(nid.getPort()).isEqualTo(10);
+    assertThat(nid.getHost()).isEqualTo("node");
     
     nid = ConverterUtils.toNodeIdWithDefaultPort("node");
-    assertEquals(nid.getPort(), 0);
-    assertEquals(nid.getHost(), "node");
+    assertThat(nid.getPort()).isEqualTo(0);
+    assertThat(nid.getHost()).isEqualTo("node");
   }
 
   @Test(expected = IllegalArgumentException.class)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestTimelineServiceHelper.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestTimelineServiceHelper.java
index d3d815b..21a27ba 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestTimelineServiceHelper.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestTimelineServiceHelper.java
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.yarn.util;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -59,7 +61,7 @@ public class TestTimelineServiceHelper {
     HashMap<String, String> alternateHashMap =
         TimelineServiceHelper.mapCastToHashMap(firstTreeMap);
     Assert.assertEquals(firstTreeMap.size(), alternateHashMap.size());
-    Assert.assertEquals(alternateHashMap.get(key), value);
+    assertThat(alternateHashMap.get(key)).isEqualTo(value);
 
     // Test complicated hashmap be casted correctly
     Map<String, Set<String>> complicatedHashMap =
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/resource/TestResourceUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/resource/TestResourceUtils.java
index f7ec4f8..7a701a4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/resource/TestResourceUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/resource/TestResourceUtils.java
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.yarn.util.resource;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.yarn.api.protocolrecords.ResourceTypes;
@@ -501,27 +503,25 @@ public class TestResourceUtils {
         ResourceInformation.newInstance("yarn.io/test-volume", "", 3));
 
     Resource addedResource = Resources.add(resourceA, resourceB);
-    Assert.assertEquals(addedResource.getMemorySize(), 5);
-    Assert.assertEquals(addedResource.getVirtualCores(), 10);
-    Assert.assertEquals(
-        addedResource.getResourceInformation("resource1").getValue(), 8);
+    assertThat(addedResource.getMemorySize()).isEqualTo(5);
+    assertThat(addedResource.getVirtualCores()).isEqualTo(10);
+    assertThat(addedResource.getResourceInformation("resource1").getValue()).
+        isEqualTo(8);
 
     // Verify that value of resourceA and resourceB is not added up for
     // "yarn.io/test-volume".
-    Assert.assertEquals(
-        addedResource.getResourceInformation("yarn.io/test-volume").getValue(),
-        2);
+    assertThat(addedResource.getResourceInformation("yarn.io/test-volume").
+        getValue()).isEqualTo(2);
 
     Resource mulResource = Resources.multiplyAndRoundDown(resourceA, 3);
-    Assert.assertEquals(mulResource.getMemorySize(), 6);
-    Assert.assertEquals(mulResource.getVirtualCores(), 12);
-    Assert.assertEquals(
-        mulResource.getResourceInformation("resource1").getValue(), 15);
+    assertThat(mulResource.getMemorySize()).isEqualTo(6);
+    assertThat(mulResource.getVirtualCores()).isEqualTo(12);
+    assertThat(mulResource.getResourceInformation("resource1").getValue()).
+        isEqualTo(15);
 
     // Verify that value of resourceA is not multiplied up for
     // "yarn.io/test-volume".
-    Assert.assertEquals(
-        mulResource.getResourceInformation("yarn.io/test-volume").getValue(),
-        2);
+    assertThat(mulResource.getResourceInformation("yarn.io/test-volume").
+        getValue()).isEqualTo(2);
   }
 }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml
index 9b2be66..aa03cbf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml
@@ -74,6 +74,11 @@
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-common</artifactId>
             <type>test-jar</type>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/adaptor/TestCsiAdaptorService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/adaptor/TestCsiAdaptorService.java
index c415ced..2375b06 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/adaptor/TestCsiAdaptorService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/adaptor/TestCsiAdaptorService.java
@@ -52,6 +52,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.api.protocolrecords.ValidateVolumeCapabilitiesRequest.AccessMode.MULTI_NODE_MULTI_WRITER;
 import static org.apache.hadoop.yarn.api.protocolrecords.ValidateVolumeCapabilitiesRequest.VolumeType.FILE_SYSTEM;
 
@@ -333,8 +334,8 @@ public class TestCsiAdaptorService {
     // Test getPluginInfo
     GetPluginInfoResponse pluginInfo =
         adaptorClient.getPluginInfo(GetPluginInfoRequest.newInstance());
-    Assert.assertEquals(pluginInfo.getDriverName(), "customized-driver");
-    Assert.assertEquals(pluginInfo.getVersion(), "1.0");
+    assertThat(pluginInfo.getDriverName()).isEqualTo("customized-driver");
+    assertThat(pluginInfo.getVersion()).isEqualTo("1.0");
 
     // Test validateVolumeCapacity
     ValidateVolumeCapabilitiesRequest request =
@@ -412,8 +413,8 @@ public class TestCsiAdaptorService {
     // Test getPluginInfo
     GetPluginInfoResponse pluginInfo =
         client1.getPluginInfo(GetPluginInfoRequest.newInstance());
-    Assert.assertEquals(pluginInfo.getDriverName(), "customized-driver-1");
-    Assert.assertEquals(pluginInfo.getVersion(), "1.0");
+    assertThat(pluginInfo.getDriverName()).isEqualTo("customized-driver-1");
+    assertThat(pluginInfo.getVersion()).isEqualTo("1.0");
 
     // Test validateVolumeCapacity
     ValidateVolumeCapabilitiesRequest request =
@@ -440,8 +441,8 @@ public class TestCsiAdaptorService {
                 driver2Addr.getLocalPort()));
     GetPluginInfoResponse pluginInfo2 =
         client2.getPluginInfo(GetPluginInfoRequest.newInstance());
-    Assert.assertEquals(pluginInfo2.getDriverName(), "customized-driver-2");
-    Assert.assertEquals(pluginInfo2.getVersion(), "1.0");
+    assertThat(pluginInfo2.getDriverName()).isEqualTo("customized-driver-2");
+    assertThat(pluginInfo2.getVersion()).isEqualTo("1.0");
 
     services.stop();
   }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
index 22f28e2..38e8cf1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/pom.xml
@@ -76,6 +76,11 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
     <dependency>
       <groupId>com.google.inject</groupId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
index ab53c48..65bd005 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -678,7 +679,7 @@ public class TestAHSWebServices extends JerseyTestBase {
         .accept(MediaType.TEXT_PLAIN)
         .get(ClientResponse.class);
     responseText = response.getEntity(String.class);
-    assertEquals(responseText.getBytes().length, fullTextSize);
+    assertThat(responseText.getBytes()).hasSize(fullTextSize);
 
     r = resource();
     response = r.path("ws").path("v1")
@@ -689,7 +690,7 @@ public class TestAHSWebServices extends JerseyTestBase {
         .accept(MediaType.TEXT_PLAIN)
         .get(ClientResponse.class);
     responseText = response.getEntity(String.class);
-    assertEquals(responseText.getBytes().length, fullTextSize);
+    assertThat(responseText.getBytes()).hasSize(fullTextSize);
   }
 
   @Test(timeout = 10000)
@@ -880,8 +881,8 @@ public class TestAHSWebServices extends JerseyTestBase {
         List<ContainerLogFileInfo> logMeta = logInfo
             .getContainerLogsInfo();
         assertTrue(logMeta.size() == 1);
-        assertEquals(logMeta.get(0).getFileName(), fileName);
-        assertEquals(logMeta.get(0).getFileSize(), String.valueOf(
+        assertThat(logMeta.get(0).getFileName()).isEqualTo(fileName);
+        assertThat(logMeta.get(0).getFileSize()).isEqualTo(String.valueOf(
             content.length()));
       } else {
         assertEquals(logInfo.getLogType(),
@@ -908,11 +909,11 @@ public class TestAHSWebServices extends JerseyTestBase {
         List<ContainerLogFileInfo> logMeta = logInfo
             .getContainerLogsInfo();
         assertTrue(logMeta.size() == 1);
-        assertEquals(logMeta.get(0).getFileName(), fileName);
-        assertEquals(logMeta.get(0).getFileSize(), String.valueOf(
+        assertThat(logMeta.get(0).getFileName()).isEqualTo(fileName);
+        assertThat(logMeta.get(0).getFileSize()).isEqualTo(String.valueOf(
             content.length()));
       } else {
-        assertEquals(logInfo.getLogType(),
+        assertThat(logInfo.getLogType()).isEqualTo(
             ContainerLogAggregationType.LOCAL.toString());
       }
     }
@@ -946,8 +947,8 @@ public class TestAHSWebServices extends JerseyTestBase {
     List<ContainerLogFileInfo> logMeta = responseText.get(0)
         .getContainerLogsInfo();
     assertTrue(logMeta.size() == 1);
-    assertEquals(logMeta.get(0).getFileName(), fileName);
-    assertEquals(logMeta.get(0).getFileSize(),
+    assertThat(logMeta.get(0).getFileName()).isEqualTo(fileName);
+    assertThat(logMeta.get(0).getFileSize()).isEqualTo(
         String.valueOf(content.length()));
   }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
index 62f3747..7377cd7 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/pom.xml
@@ -96,6 +96,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.zookeeper</groupId>
       <artifactId>zookeeper</artifactId>
     </dependency>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/manager/BasePolicyManagerTest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/manager/BasePolicyManagerTest.java
index bd99cb5..55be316 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/manager/BasePolicyManagerTest.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/manager/BasePolicyManagerTest.java
@@ -17,6 +17,8 @@
 
 package org.apache.hadoop.yarn.server.federation.policies.manager;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext;
 import org.apache.hadoop.yarn.server.federation.policies.amrmproxy.FederationAMRMProxyPolicy;
 import org.apache.hadoop.yarn.server.federation.policies.exceptions.FederationPolicyInitializationException;
@@ -24,7 +26,6 @@ import org.apache.hadoop.yarn.server.federation.policies.router.FederationRouter
 import org.apache.hadoop.yarn.server.federation.store.records.SubClusterId;
 import org.apache.hadoop.yarn.server.federation.store.records.SubClusterPolicyConfiguration;
 import org.apache.hadoop.yarn.server.federation.utils.FederationPoliciesTestUtil;
-import org.junit.Assert;
 import org.junit.Test;
 
 /**
@@ -92,10 +93,10 @@ public abstract class BasePolicyManagerTest {
     FederationRouterPolicy federationRouterPolicy =
         wfp2.getRouterPolicy(context, null);
 
-    Assert.assertEquals(federationAMRMProxyPolicy.getClass(),
-        expAMRMProxyPolicy);
+    assertThat(federationAMRMProxyPolicy).
+        isExactlyInstanceOf(expAMRMProxyPolicy);
 
-    Assert.assertEquals(federationRouterPolicy.getClass(), expRouterPolicy);
+    assertThat(federationRouterPolicy).isExactlyInstanceOf(expRouterPolicy);
   }
 
 }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
index 3c74a20..1a86a9a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/pom.xml
@@ -132,6 +132,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>com.google.inject</groupId>
       <artifactId>guice</artifactId>
     </dependency>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
index 51c7d96..3d9d33c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.test.PlatformAssumptions.assumeNotWindows;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
@@ -306,33 +307,34 @@ public class TestLinuxContainerExecutorWithMocks {
           .build());
 
       List<String> result=readMockParams();
-      Assert.assertEquals(result.size(), 26);
-      Assert.assertEquals(result.get(0), YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER);
-      Assert.assertEquals(result.get(1), "test");
-      Assert.assertEquals(result.get(2), "0" );
-      Assert.assertEquals(result.get(3), "application_0");
-      Assert.assertEquals(result.get(4), "12345");
-      Assert.assertEquals(result.get(5), "/bin/nmPrivateCTokensPath");
-      Assert.assertEquals(result.get(9), "-classpath" );
-      Assert.assertEquals(result.get(12), "-Xmx256m" );
-      Assert.assertEquals(result.get(13),
+      assertThat(result).hasSize(26);
+      assertThat(result.get(0)).isEqualTo(YarnConfiguration.
+          DEFAULT_NM_NONSECURE_MODE_LOCAL_USER);
+      assertThat(result.get(1)).isEqualTo("test");
+      assertThat(result.get(2)).isEqualTo("0");
+      assertThat(result.get(3)).isEqualTo("application_0");
+      assertThat(result.get(4)).isEqualTo("12345");
+      assertThat(result.get(5)).isEqualTo("/bin/nmPrivateCTokensPath");
+      assertThat(result.get(9)).isEqualTo("-classpath");
+      assertThat(result.get(12)).isEqualTo("-Xmx256m");
+      assertThat(result.get(13)).isEqualTo(
           "-Dlog4j.configuration=container-log4j.properties" );
-      Assert.assertEquals(result.get(14),
+      assertThat(result.get(14)).isEqualTo(
           String.format("-Dyarn.app.container.log.dir=%s/application_0/12345",
           mockExec.getConf().get(YarnConfiguration.NM_LOG_DIRS)));
-      Assert.assertEquals(result.get(15),
+      assertThat(result.get(15)).isEqualTo(
           "-Dyarn.app.container.log.filesize=0");
-      Assert.assertEquals(result.get(16), "-Dhadoop.root.logger=INFO,CLA");
-      Assert.assertEquals(result.get(17),
+      assertThat(result.get(16)).isEqualTo("-Dhadoop.root.logger=INFO,CLA");
+      assertThat(result.get(17)).isEqualTo(
           "-Dhadoop.root.logfile=container-localizer-syslog");
-      Assert.assertEquals(result.get(18),
-          "org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer");
-      Assert.assertEquals(result.get(19), "test");
-      Assert.assertEquals(result.get(20), "application_0");
-      Assert.assertEquals(result.get(21), "12345");
-      Assert.assertEquals(result.get(22), "localhost");
-      Assert.assertEquals(result.get(23), "8040");
-      Assert.assertEquals(result.get(24), "nmPrivateCTokensPath");
+      assertThat(result.get(18)).isEqualTo("org.apache.hadoop.yarn.server." +
+          "nodemanager.containermanager.localizer.ContainerLocalizer");
+      assertThat(result.get(19)).isEqualTo("test");
+      assertThat(result.get(20)).isEqualTo("application_0");
+      assertThat(result.get(21)).isEqualTo("12345");
+      assertThat(result.get(22)).isEqualTo("localhost");
+      assertThat(result.get(23)).isEqualTo("8040");
+      assertThat(result.get(24)).isEqualTo("nmPrivateCTokensPath");
 
     } catch (InterruptedException e) {
       LOG.error("Error:"+e.getMessage(),e);
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/TestContainerManagerRecovery.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/TestContainerManagerRecovery.java
index e129caa..e920105 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/TestContainerManagerRecovery.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/TestContainerManagerRecovery.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.containermanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -302,7 +303,7 @@ public class TestContainerManagerRecovery extends BaseContainerManagerTest {
     // simulate log aggregation completion
     app.handle(new ApplicationEvent(app.getAppId(),
         ApplicationEventType.APPLICATION_RESOURCES_CLEANEDUP));
-    assertEquals(app.getApplicationState(), ApplicationState.FINISHED);
+    assertThat(app.getApplicationState()).isEqualTo(ApplicationState.FINISHED);
     app.handle(new ApplicationEvent(app.getAppId(),
         ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED));
 
@@ -362,7 +363,7 @@ public class TestContainerManagerRecovery extends BaseContainerManagerTest {
 
     app.handle(new ApplicationEvent(app.getAppId(),
         ApplicationEventType.APPLICATION_RESOURCES_CLEANEDUP));
-    assertEquals(app.getApplicationState(), ApplicationState.FINISHED);
+    assertThat(app.getApplicationState()).isEqualTo(ApplicationState.FINISHED);
     // application is still in NM context.
     assertEquals(1, context.getApplications().size());
 
@@ -386,7 +387,7 @@ public class TestContainerManagerRecovery extends BaseContainerManagerTest {
     // is needed.
     app.handle(new ApplicationEvent(app.getAppId(),
         ApplicationEventType.APPLICATION_RESOURCES_CLEANEDUP));
-    assertEquals(app.getApplicationState(), ApplicationState.FINISHED);
+    assertThat(app.getApplicationState()).isEqualTo(ApplicationState.FINISHED);
 
     // simulate log aggregation failed.
     app.handle(new ApplicationEvent(app.getAppId(),
@@ -528,7 +529,8 @@ public class TestContainerManagerRecovery extends BaseContainerManagerTest {
 
     ResourceUtilization utilization =
         ResourceUtilization.newInstance(1024, 2048, 1.0F);
-    assertEquals(cm.getContainerScheduler().getNumRunningContainers(), 1);
+    assertThat(cm.getContainerScheduler().getNumRunningContainers()).
+        isEqualTo(1);
     assertEquals(utilization,
         cm.getContainerScheduler().getCurrentUtilization());
 
@@ -544,7 +546,8 @@ public class TestContainerManagerRecovery extends BaseContainerManagerTest {
     assertNotNull(app);
     waitForNMContainerState(cm, cid, ContainerState.RUNNING);
 
-    assertEquals(cm.getContainerScheduler().getNumRunningContainers(), 1);
+    assertThat(cm.getContainerScheduler().getNumRunningContainers()).
+        isEqualTo(1);
     assertEquals(utilization,
         cm.getContainerScheduler().getCurrentUtilization());
     cm.stop();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java
index e048577..bda7803 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java
@@ -18,9 +18,11 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.test.PlatformAssumptions.assumeWindows;
 import static org.apache.hadoop.test.PlatformAssumptions.assumeNotWindows;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.*;
 
@@ -124,7 +126,6 @@ import org.apache.hadoop.yarn.util.Apps;
 import org.apache.hadoop.yarn.util.AuxiliaryServiceHelper;
 import org.apache.hadoop.yarn.util.LinuxResourceCalculatorPlugin;
 import org.apache.hadoop.yarn.util.ResourceCalculatorPlugin;
-import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Before;
@@ -212,7 +213,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
       = new Shell.ShellCommandExecutor(new String[]{tempFile.getAbsolutePath()}, tmpDir);
 
       shexc.execute();
-      assertEquals(shexc.getExitCode(), 0);
+      assertThat(shexc.getExitCode()).isEqualTo(0);
       //Capture output from prelaunch.out
 
       List<String> output = Files.readAllLines(Paths.get(localLogDir.getAbsolutePath(), ContainerLaunch.CONTAINER_PRE_LAUNCH_STDOUT),
@@ -1485,7 +1486,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
               "X", Shell.WINDOWS_MAX_SHELL_LENGTH -callCmd.length() + 1)));
       fail("longCommand was expected to throw");
     } catch(IOException e) {
-      assertThat(e.getMessage(), CoreMatchers.containsString(expectedMessage));
+      assertThat(e).hasMessageContaining(expectedMessage);
     }
 
     // Composite tests, from parts: less, exact and +
@@ -1507,7 +1508,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
           org.apache.commons.lang3.StringUtils.repeat("X", 2048 - callCmd.length())));
       fail("long commands was expected to throw");
     } catch(IOException e) {
-      assertThat(e.getMessage(), CoreMatchers.containsString(expectedMessage));
+      assertThat(e).hasMessageContaining(expectedMessage);
     }
   }
   
@@ -1530,7 +1531,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
           "A", Shell.WINDOWS_MAX_SHELL_LENGTH - ("@set somekey=").length()) + 1);
       fail("long env was expected to throw");
     } catch(IOException e) {
-      assertThat(e.getMessage(), CoreMatchers.containsString(expectedMessage));
+      assertThat(e).hasMessageContaining(expectedMessage);
     }
   }
     
@@ -1555,8 +1556,8 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
           "X", (Shell.WINDOWS_MAX_SHELL_LENGTH - mkDirCmd.length())/2 +1)));
       fail("long mkdir was expected to throw");
     } catch(IOException e) {
-      assertThat(e.getMessage(), CoreMatchers.containsString(expectedMessage));
-    }    
+      assertThat(e).hasMessageContaining(expectedMessage);
+    }
   }
 
   @Test (timeout = 10000)
@@ -1586,7 +1587,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
               "Y", (Shell.WINDOWS_MAX_SHELL_LENGTH - linkCmd.length())/2) + 1));
       fail("long link was expected to throw");
     } catch(IOException e) {
-      assertThat(e.getMessage(), CoreMatchers.containsString(expectedMessage));
+      assertThat(e).hasMessageContaining(expectedMessage);
     }
   }
 
@@ -1747,7 +1748,7 @@ public class TestContainerLaunch extends BaseContainerManagerTest {
           new String[] { tempFile.getAbsolutePath() }, tmpDir);
 
         shexc.execute();
-        assertEquals(shexc.getExitCode(), 0);
+        assertThat(shexc.getExitCode()).isEqualTo(0);
         File directorInfo =
           new File(localLogDir, ContainerExecutor.DIRECTORY_CONTENTS);
         File scriptCopy = new File(localLogDir, tempFile.getName());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestResourceHandlerModule.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestResourceHandlerModule.java
index 9456303..171bfaf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestResourceHandlerModule.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestResourceHandlerModule.java
@@ -20,6 +20,8 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.server.nodemanager.Context;
@@ -71,7 +73,7 @@ public class TestResourceHandlerModule {
         List<ResourceHandler> resourceHandlers = resourceHandlerChain
             .getResourceHandlerList();
         //Exactly one resource handler in chain
-        Assert.assertEquals(resourceHandlers.size(), 1);
+        assertThat(resourceHandlers).hasSize(1);
         //Same instance is expected to be in the chain.
         Assert.assertTrue(resourceHandlers.get(0) == resourceHandler);
       } else {
@@ -102,7 +104,7 @@ public class TestResourceHandlerModule {
       List<ResourceHandler> resourceHandlers =
           resourceHandlerChain.getResourceHandlerList();
       // Exactly one resource handler in chain
-      Assert.assertEquals(resourceHandlers.size(), 1);
+      assertThat(resourceHandlers).hasSize(1);
       // Same instance is expected to be in the chain.
       Assert.assertTrue(resourceHandlers.get(0) == handler);
     } else {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
index 9f5f608..8871bf6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -1325,15 +1326,15 @@ public class TestResourceLocalizationService {
     // hence its not removed despite ref cnt being 0.
     LocalizedResource rsrc1 = tracker.getLocalizedResource(req1);
     assertNotNull(rsrc1);
-    assertEquals(rsrc1.getState(), ResourceState.LOCALIZED);
-    assertEquals(rsrc1.getRefCount(), 0);
+    assertThat(rsrc1.getState()).isEqualTo(ResourceState.LOCALIZED);
+    assertThat(rsrc1.getRefCount()).isEqualTo(0);
 
     // Container c1 was killed but this resource is referenced by container c2
     // as well hence its ref cnt is 1.
     LocalizedResource rsrc2 = tracker.getLocalizedResource(req2);
     assertNotNull(rsrc2);
-    assertEquals(rsrc2.getState(), ResourceState.DOWNLOADING);
-    assertEquals(rsrc2.getRefCount(), 1);
+    assertThat(rsrc2.getState()).isEqualTo(ResourceState.DOWNLOADING);
+    assertThat(rsrc2.getRefCount()).isEqualTo(1);
 
     // As container c1 was killed and this resource was not referenced by any
     // other container, hence its removed.
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
index 000b73b..796c7e7 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
@@ -870,7 +871,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
     };
     checkEvents(appEventHandler, expectedEvents, false,
         "getType", "getApplicationID", "getDiagnostic");
-    Assert.assertEquals(logAggregationService.getInvalidTokenApps().size(), 1);
+    assertThat(logAggregationService.getInvalidTokenApps()).hasSize(1);
     // verify trying to collect logs for containers/apps we don't know about
     // doesn't blow up and tear down the NM
     logAggregationService.handle(new LogHandlerContainerFinishedEvent(
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/com/nvidia/TestNvidiaGPUPluginForRuntimeV2.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/com/nvidia/TestNvidiaGPUPluginForRuntimeV2.java
index 595ee08..7b848cf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/com/nvidia/TestNvidiaGPUPluginForRuntimeV2.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/com/nvidia/TestNvidiaGPUPluginForRuntimeV2.java
@@ -39,6 +39,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyMap;
 import static org.mockito.ArgumentMatchers.anySet;
@@ -265,7 +266,7 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     reset(spyPlugin);
     Set<Device> allocation = spyPlugin.allocateDevices(copyAvailableDevices,
         1, env);
-    Assert.assertEquals(allocation.size(), 1);
+    assertThat(allocation).hasSize(1);
     verify(spyPlugin).basicSchedule(anySet(), anyInt(), anySet());
     Assert.assertFalse(spyPlugin.isTopoInitialized());
 
@@ -273,7 +274,7 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     reset(spyPlugin);
     allocation = spyPlugin.allocateDevices(allDevices, 1, env);
     // ensure no topology scheduling needed
-    Assert.assertEquals(allocation.size(), 1);
+    assertThat(allocation).hasSize(1);
     verify(spyPlugin).basicSchedule(anySet(), anyInt(), anySet());
     reset(spyPlugin);
     // Case 2. allocate all available
@@ -285,13 +286,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     int count = 2;
     Map<String, Integer> pairToWeight = spyPlugin.getDevicePairToWeight();
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     Device[] allocatedDevices =
         allocation.toArray(new Device[count]);
     // Check weights
@@ -302,13 +303,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     reset(spyPlugin);
     count = 3;
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin, times(0)).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     allocatedDevices =
         allocation.toArray(new Device[count]);
     // check weights
@@ -327,13 +328,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     iterator.remove();
     count = 2;
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin, times(0)).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     allocatedDevices =
         allocation.toArray(new Device[count]);
     // check weights
@@ -377,13 +378,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     int count = 2;
     Map<String, Integer> pairToWeight = spyPlugin.getDevicePairToWeight();
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     Device[] allocatedDevices =
         allocation.toArray(new Device[count]);
     // Check weights
@@ -394,13 +395,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     reset(spyPlugin);
     count = 3;
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin, times(0)).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     allocatedDevices =
         allocation.toArray(new Device[count]);
     // check weights
@@ -419,13 +420,13 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     iterator.remove();
     count = 2;
     allocation = spyPlugin.allocateDevices(allDevices, count, env);
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     // the costTable should be init and used topology scheduling
     verify(spyPlugin, times(0)).initCostTable();
     Assert.assertTrue(spyPlugin.isTopoInitialized());
     verify(spyPlugin).topologyAwareSchedule(anySet(), anyInt(), anyMap(),
         anySet(), anyMap());
-    Assert.assertEquals(allocation.size(), count);
+    assertThat(allocation).hasSize(count);
     allocatedDevices =
         allocation.toArray(new Device[count]);
     // check weights
@@ -574,7 +575,7 @@ public class TestNvidiaGPUPluginForRuntimeV2 {
     report.readFromFile();
     ArrayList<ActualPerformanceReport.DataRecord> dataSet =
         report.getDataSet();
-    Assert.assertEquals(dataSet.size(), 2952);
+    assertThat(dataSet).hasSize(2952);
     String[] allModels = {"alexnet", "resnet50", "vgg16", "inception3"};
     int[] batchSizes = {32, 64, 128};
     int[] gpuCounts = {2, 3, 4, 5, 6, 7};
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/recovery/TestNMLeveldbStateStoreService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/recovery/TestNMLeveldbStateStoreService.java
index 157e5d3..bd86f59 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/recovery/TestNMLeveldbStateStoreService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/recovery/TestNMLeveldbStateStoreService.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager.recovery;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.fusesource.leveldbjni.JniDBFactory.bytes;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -36,6 +37,7 @@ import static org.mockito.Mockito.when;
 
 import java.io.File;
 import java.io.IOException;
+
 import java.io.Serializable;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
@@ -1350,9 +1352,9 @@ public class TestNMLeveldbStateStoreService {
   @Test
   public void testAMRMProxyStorage() throws IOException {
     RecoveredAMRMProxyState state = stateStore.loadAMRMProxyState();
-    assertEquals(state.getCurrentMasterKey(), null);
-    assertEquals(state.getNextMasterKey(), null);
-    assertEquals(state.getAppContexts().size(), 0);
+    assertThat(state.getCurrentMasterKey()).isNull();
+    assertThat(state.getNextMasterKey()).isNull();
+    assertThat(state.getAppContexts()).isEmpty();
 
     ApplicationId appId1 = ApplicationId.newInstance(1, 1);
     ApplicationId appId2 = ApplicationId.newInstance(1, 2);
@@ -1384,18 +1386,18 @@ public class TestNMLeveldbStateStoreService {
       state = stateStore.loadAMRMProxyState();
       assertEquals(state.getCurrentMasterKey(),
           secretManager.getCurrentMasterKeyData().getMasterKey());
-      assertEquals(state.getNextMasterKey(), null);
-      assertEquals(state.getAppContexts().size(), 2);
+      assertThat(state.getNextMasterKey()).isNull();
+      assertThat(state.getAppContexts()).hasSize(2);
       // app1
       Map<String, byte[]> map = state.getAppContexts().get(attemptId1);
       assertNotEquals(map, null);
-      assertEquals(map.size(), 2);
+      assertThat(map).hasSize(2);
       assertTrue(Arrays.equals(map.get(key1), data1));
       assertTrue(Arrays.equals(map.get(key2), data2));
       // app2
       map = state.getAppContexts().get(attemptId2);
       assertNotEquals(map, null);
-      assertEquals(map.size(), 2);
+      assertThat(map).hasSize(2);
       assertTrue(Arrays.equals(map.get(key1), data1));
       assertTrue(Arrays.equals(map.get(key2), data2));
 
@@ -1414,14 +1416,14 @@ public class TestNMLeveldbStateStoreService {
       assertEquals(state.getAppContexts().size(), 2);
       // app1
       map = state.getAppContexts().get(attemptId1);
-      assertNotEquals(map, null);
-      assertEquals(map.size(), 2);
+      assertThat(map).isNotNull();
+      assertThat(map).hasSize(2);
       assertTrue(Arrays.equals(map.get(key1), data1));
       assertTrue(Arrays.equals(map.get(key2), data2));
       // app2
       map = state.getAppContexts().get(attemptId2);
-      assertNotEquals(map, null);
-      assertEquals(map.size(), 1);
+      assertThat(map).isNotNull();
+      assertThat(map).hasSize(1);
       assertTrue(Arrays.equals(map.get(key2), data2));
 
       // Activate next master key and remove all entries of app1
@@ -1434,12 +1436,12 @@ public class TestNMLeveldbStateStoreService {
       state = stateStore.loadAMRMProxyState();
       assertEquals(state.getCurrentMasterKey(),
           secretManager.getCurrentMasterKeyData().getMasterKey());
-      assertEquals(state.getNextMasterKey(), null);
-      assertEquals(state.getAppContexts().size(), 1);
+      assertThat(state.getNextMasterKey()).isNull();
+      assertThat(state.getAppContexts()).hasSize(1);
       // app2 only
       map = state.getAppContexts().get(attemptId2);
-      assertNotEquals(map, null);
-      assertEquals(map.size(), 1);
+      assertThat(map).isNotNull();
+      assertThat(map).hasSize(1);
       assertTrue(Arrays.equals(map.get(key2), data2));
     } finally {
       secretManager.stop();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
index 62774f5..740af8f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
@@ -96,6 +96,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -704,7 +705,7 @@ public class TestNMWebServices extends JerseyTestBase {
     List<ContainerLogFileInfo> logMeta = responseList.get(0)
         .getContainerLogsInfo();
     assertTrue(logMeta.size() == 1);
-    assertEquals(logMeta.get(0).getFileName(), filename);
+    assertThat(logMeta.get(0).getFileName()).isEqualTo(filename);
 
     // now create an aggregated log in Remote File system
     File tempLogDir = new File("target",
@@ -724,19 +725,19 @@ public class TestNMWebServices extends JerseyTestBase {
       assertEquals(200, response.getStatus());
       responseList = response.getEntity(new GenericType<
           List<ContainerLogsInfo>>(){});
-      assertEquals(responseList.size(), 2);
+      assertThat(responseList).hasSize(2);
       for (ContainerLogsInfo logInfo : responseList) {
         if(logInfo.getLogType().equals(
             ContainerLogAggregationType.AGGREGATED.toString())) {
           List<ContainerLogFileInfo> meta = logInfo.getContainerLogsInfo();
           assertTrue(meta.size() == 1);
-          assertEquals(meta.get(0).getFileName(), aggregatedLogFile);
+          assertThat(meta.get(0).getFileName()).isEqualTo(aggregatedLogFile);
         } else {
           assertEquals(logInfo.getLogType(),
               ContainerLogAggregationType.LOCAL.toString());
           List<ContainerLogFileInfo> meta = logInfo.getContainerLogsInfo();
           assertTrue(meta.size() == 1);
-          assertEquals(meta.get(0).getFileName(), filename);
+          assertThat(meta.get(0).getFileName()).isEqualTo(filename);
         }
       }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
index f40ca0e..45eca49 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
@@ -58,6 +58,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
     <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
index 6049c11..3eed0be 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
@@ -1788,7 +1789,7 @@ public class TestClientRMService {
 
     // Ensure all reservations are filtered out.
     Assert.assertNotNull(response);
-    Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+    assertThat(response.getReservationAllocationState()).isEmpty();
 
     duration = 30000;
     deadline = sRequest.getReservationDefinition().getDeadline();
@@ -1808,7 +1809,7 @@ public class TestClientRMService {
 
     // Ensure all reservations are filtered out.
     Assert.assertNotNull(response);
-    Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+    assertThat(response.getReservationAllocationState()).isEmpty();
 
     arrival = clock.getTime();
     // List reservations, search by end time before the reservation start
@@ -1826,7 +1827,7 @@ public class TestClientRMService {
 
     // Ensure all reservations are filtered out.
     Assert.assertNotNull(response);
-    Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+    assertThat(response.getReservationAllocationState()).isEmpty();
 
     // List reservations, search by very small end time.
     request = ReservationListRequest
@@ -1841,7 +1842,7 @@ public class TestClientRMService {
 
     // Ensure all reservations are filtered out.
     Assert.assertNotNull(response);
-    Assert.assertEquals(response.getReservationAllocationState().size(), 0);
+    assertThat(response.getReservationAllocationState()).isEmpty();
 
     rm.stop();
   }
@@ -2012,7 +2013,7 @@ public class TestClientRMService {
         Arrays.asList(node1A)));
     Assert.assertTrue(labelsToNodes.get(labelZ.getName()).containsAll(
         Arrays.asList(node1B, node3B)));
-    Assert.assertEquals(labelsToNodes.get(labelY.getName()), null);
+    assertThat(labelsToNodes.get(labelY.getName())).isNull();
 
     rpc.stopProxy(client, conf);
     rm.close();
@@ -2113,10 +2114,10 @@ public class TestClientRMService {
         client.getAttributesToNodes(request);
     Map<NodeAttributeKey, List<NodeToAttributeValue>> attrs =
         response.getAttributesToNodes();
-    Assert.assertEquals(response.getAttributesToNodes().size(), 4);
-    Assert.assertEquals(attrs.get(dist.getAttributeKey()).size(), 2);
-    Assert.assertEquals(attrs.get(os.getAttributeKey()).size(), 1);
-    Assert.assertEquals(attrs.get(gpu.getAttributeKey()).size(), 1);
+    assertThat(response.getAttributesToNodes()).hasSize(4);
+    assertThat(attrs.get(dist.getAttributeKey())).hasSize(2);
+    assertThat(attrs.get(os.getAttributeKey())).hasSize(1);
+    assertThat(attrs.get(gpu.getAttributeKey())).hasSize(1);
     Assert.assertTrue(findHostnameAndValInMapping(node1, "3_0_2",
         attrs.get(dist.getAttributeKey())));
     Assert.assertTrue(findHostnameAndValInMapping(node2, "3_0_2",
@@ -2130,7 +2131,7 @@ public class TestClientRMService {
         client.getAttributesToNodes(request2);
     Map<NodeAttributeKey, List<NodeToAttributeValue>> attrs2 =
         response2.getAttributesToNodes();
-    Assert.assertEquals(attrs2.size(), 1);
+    assertThat(attrs2).hasSize(1);
     Assert.assertTrue(findHostnameAndValInMapping(node2, "docker0",
         attrs2.get(docker.getAttributeKey())));
 
@@ -2141,7 +2142,7 @@ public class TestClientRMService {
         client.getAttributesToNodes(request3);
     Map<NodeAttributeKey, List<NodeToAttributeValue>> attrs3 =
         response3.getAttributesToNodes();
-    Assert.assertEquals(attrs3.size(), 2);
+    assertThat(attrs3).hasSize(2);
     Assert.assertTrue(findHostnameAndValInMapping(node1, "windows64",
         attrs3.get(os.getAttributeKey())));
     Assert.assertTrue(findHostnameAndValInMapping(node2, "docker0",
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestKillApplicationWithRMHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestKillApplicationWithRMHA.java
index 30443d7..979d8c7 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestKillApplicationWithRMHA.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestKillApplicationWithRMHA.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
@@ -150,7 +151,7 @@ public class TestKillApplicationWithRMHA extends RMHATestBase{
     MockAM am0 = launchAM(app0, rm1, nm1);
 
     // ensure that the app is in running state
-    Assert.assertEquals(app0.getState(), RMAppState.RUNNING);
+    assertThat(app0.getState()).isEqualTo(RMAppState.RUNNING);
 
     // kill the app.
     rm1.killApp(app0.getApplicationId());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java
index 01c89d3..6659f10 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -608,7 +609,7 @@ public class TestRMAdminService {
         Assert.assertEquals(accessList.getAclString(),
             aclString);
       } else {
-        Assert.assertEquals(accessList.getAclString(), "*");
+        assertThat(accessList.getAclString()).isEqualTo("*");
       }
     }
   }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
index 3b3bd4b..4b11296 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
@@ -22,6 +22,7 @@ import com.google.common.base.Supplier;
 import org.apache.hadoop.test.GenericTestUtils;
 import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeUpdateSchedulerEvent;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -381,14 +382,14 @@ public class TestRMHA {
     rm = new MockRM(conf);
     rm.init(conf);
 
-    assertEquals(conf.get(YarnConfiguration.RM_HA_ID), RM2_NODE_ID);
+    assertThat(conf.get(YarnConfiguration.RM_HA_ID)).isEqualTo(RM2_NODE_ID);
 
     //test explicitly lookup HA-ID
     configuration.set(YarnConfiguration.RM_HA_ID, RM1_NODE_ID);
     conf = new YarnConfiguration(configuration);
     rm = new MockRM(conf);
     rm.init(conf);
-    assertEquals(conf.get(YarnConfiguration.RM_HA_ID), RM1_NODE_ID);
+    assertThat(conf.get(YarnConfiguration.RM_HA_ID)).isEqualTo(RM1_NODE_ID);
 
     //test if RM_HA_ID can not be found
     configuration
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
index f09850a..87a9423 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.ArgumentMatchers.isA;
@@ -609,7 +610,7 @@ public class TestRMRestart extends ParameterizedSchedulerTestBase {
     MockAM am2 = launchAM(app1, rm1, nm1);
 
     Assert.assertEquals(1, rmAppState.size());
-    Assert.assertEquals(app1.getState(), RMAppState.RUNNING);
+    assertThat(app1.getState()).isEqualTo(RMAppState.RUNNING);
     Assert.assertEquals(app1.getAppAttempts()
         .get(app1.getCurrentAppAttempt().getAppAttemptId())
         .getAppAttemptState(), RMAppAttemptState.RUNNING);
@@ -665,7 +666,7 @@ public class TestRMRestart extends ParameterizedSchedulerTestBase {
     rmApp = rm3.getRMContext().getRMApps().get(app1.getApplicationId());
     // application should be in ACCEPTED state
     rm3.waitForState(app1.getApplicationId(), RMAppState.ACCEPTED);
-    Assert.assertEquals(rmApp.getState(), RMAppState.ACCEPTED);
+    assertThat(rmApp.getState()).isEqualTo(RMAppState.ACCEPTED);
     // new attempt should not be started
     Assert.assertEquals(3, rmApp.getAppAttempts().size());
     // am1 and am2 attempts should be in FAILED state where as am3 should be
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMServerUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMServerUtils.java
index 9c233b9..78fa90d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMServerUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMServerUtils.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.api.records.ContainerUpdateType.INCREASE_RESOURCE;
 import static org.apache.hadoop.yarn.server.resourcemanager.RMServerUtils.RESOURCE_OUTSIDE_ALLOWED_RANGE;
 
@@ -140,22 +141,22 @@ public class TestRMServerUtils {
     List<RMNode> result = RMServerUtils.queryRMNodes(rmContext,
         EnumSet.of(NodeState.SHUTDOWN));
     Assert.assertTrue(result.size() != 0);
-    Assert.assertEquals(result.get(0), rmNode1);
+    assertThat(result.get(0)).isEqualTo(rmNode1);
     when(rmNode1.getState()).thenReturn(NodeState.DECOMMISSIONED);
     result = RMServerUtils.queryRMNodes(rmContext,
         EnumSet.of(NodeState.DECOMMISSIONED));
     Assert.assertTrue(result.size() != 0);
-    Assert.assertEquals(result.get(0), rmNode1);
+    assertThat(result.get(0)).isEqualTo(rmNode1);
     when(rmNode1.getState()).thenReturn(NodeState.LOST);
     result = RMServerUtils.queryRMNodes(rmContext,
         EnumSet.of(NodeState.LOST));
     Assert.assertTrue(result.size() != 0);
-    Assert.assertEquals(result.get(0), rmNode1);
+    assertThat(result.get(0)).isEqualTo(rmNode1);
     when(rmNode1.getState()).thenReturn(NodeState.REBOOTED);
     result = RMServerUtils.queryRMNodes(rmContext,
         EnumSet.of(NodeState.REBOOTED));
     Assert.assertTrue(result.size() != 0);
-    Assert.assertEquals(result.get(0), rmNode1);
+    assertThat(result.get(0)).isEqualTo(rmNode1);
   }
 
   @Test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java
index fa5f135..d503cb4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java
@@ -100,6 +100,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
+
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.PREFIX;
 
 import static org.apache.hadoop.yarn.server.resourcemanager.scheduler
@@ -263,7 +265,8 @@ public class TestWorkPreservingRMRestart extends ParameterizedSchedulerTestBase
       scheduler.getRMContainer(amContainer.getContainerId())));
     assertTrue(schedulerAttempt.getLiveContainers().contains(
       scheduler.getRMContainer(runningContainer.getContainerId())));
-    assertEquals(schedulerAttempt.getCurrentConsumption(), usedResources);
+    assertThat(schedulerAttempt.getCurrentConsumption()).
+        isEqualTo(usedResources);
 
     // *********** check appSchedulingInfo state ***********
     assertEquals((1L << 40) + 1L, schedulerAttempt.getNewContainerId());
@@ -421,7 +424,8 @@ public class TestWorkPreservingRMRestart extends ParameterizedSchedulerTestBase
         .contains(scheduler.getRMContainer(amContainer.getContainerId())));
     assertTrue(schedulerAttempt.getLiveContainers()
         .contains(scheduler.getRMContainer(runningContainer.getContainerId())));
-    assertEquals(schedulerAttempt.getCurrentConsumption(), usedResources);
+    assertThat(schedulerAttempt.getCurrentConsumption()).
+        isEqualTo(usedResources);
 
     // *********** check appSchedulingInfo state ***********
     assertEquals((1L << 40) + 1L, schedulerAttempt.getNewContainerId());
@@ -775,8 +779,9 @@ public class TestWorkPreservingRMRestart extends ParameterizedSchedulerTestBase
     ApplicationReport report = rm2.getApplicationReport(app.getApplicationId());
     assertEquals(report.getFinalApplicationStatus(),
         FinalApplicationStatus.KILLED);
-    assertEquals(report.getYarnApplicationState(), YarnApplicationState.KILLED);
-    assertEquals(report.getDiagnostics(), diagnostics);
+    assertThat(report.getYarnApplicationState()).
+        isEqualTo(YarnApplicationState.KILLED);
+    assertThat(report.getDiagnostics()).isEqualTo(diagnostics);
 
     //Reload previous state with cloned app sub context object
     RMState newState = memStore2.reloadStateWithClonedAppSubCtxt(state);
@@ -1730,7 +1735,8 @@ public class TestWorkPreservingRMRestart extends ParameterizedSchedulerTestBase
         .contains(scheduler.getRMContainer(amContainer.getContainerId())));
     assertTrue(schedulerAttempt.getLiveContainers()
         .contains(scheduler.getRMContainer(runningContainer.getContainerId())));
-    assertEquals(schedulerAttempt.getCurrentConsumption(), usedResources);
+    assertThat(schedulerAttempt.getCurrentConsumption()).
+        isEqualTo(usedResources);
 
     // *********** check appSchedulingInfo state ***********
     assertEquals((1L << 40) + 1L, schedulerAttempt.getNewContainerId());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisher.java
index 64c9063..35f55c6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisher.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.metrics;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -290,7 +291,7 @@ public class TestSystemMetricsPublisher {
         } else if (event.getEventType().equals(
               ApplicationMetricsConstants.STATE_UPDATED_EVENT_TYPE)) {
           hasStateUpdateEvent = true;
-          Assert.assertEquals(event.getTimestamp(), stateUpdateTimeStamp);
+          assertThat(event.getTimestamp()).isEqualTo(stateUpdateTimeStamp);
           Assert.assertEquals(YarnApplicationState.RUNNING.toString(), event
               .getEventInfo().get(
                    ApplicationMetricsConstants.STATE_EVENT_INFO));
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyPreemptToBalance.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyPreemptToBalance.java
index 6f67e4b..8c0eee6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyPreemptToBalance.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyPreemptToBalance.java
@@ -27,6 +27,7 @@ import org.junit.Test;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Set;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.Mockito.times;
@@ -230,7 +231,8 @@ public class TestProportionalCapacityPreemptionPolicyPreemptToBalance
         FifoCandidatesSelector pcs = (FifoCandidatesSelector) pc.getKey();
         if (pcs.getAllowQueuesBalanceAfterAllQueuesSatisfied() == true) {
           hasFifoSelector = true;
-          assertEquals(pcs.getMaximumKillWaitTimeMs(), FB_MAX_BEFORE_KILL);
+          assertThat(pcs.getMaximumKillWaitTimeMs()).
+              isEqualTo(FB_MAX_BEFORE_KILL);
         }
       }
     }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestFileSystemNodeAttributeStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestFileSystemNodeAttributeStore.java
index a53b88e..a05cf3e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestFileSystemNodeAttributeStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestFileSystemNodeAttributeStore.java
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.yarn.server.resourcemanager.nodelabels;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
@@ -139,8 +140,8 @@ public class TestFileSystemNodeAttributeStore {
         toAddAttributes);
     Map<NodeAttribute, AttributeValue> attrs =
         mgr.getAttributesForNode("host0");
-    Assert.assertEquals(attrs.size(), 1);
-    Assert.assertEquals(attrs.keySet().toArray()[0], docker);
+    assertThat(attrs).hasSize(1);
+    assertThat(attrs.keySet().toArray()[0]).isEqualTo(docker);
     mgr.stop();
 
     // Start new attribute manager with same path
@@ -154,8 +155,8 @@ public class TestFileSystemNodeAttributeStore {
     Assert.assertEquals("host1 size", 1,
         mgr.getAttributesForNode("host1").size());
     attrs = mgr.getAttributesForNode("host0");
-    Assert.assertEquals(attrs.size(), 1);
-    Assert.assertEquals(attrs.keySet().toArray()[0], docker);
+    assertThat(attrs).hasSize(1);
+    assertThat(attrs.keySet().toArray()[0]).isEqualTo(docker);
     //------host0----
     // current       - docker
     // replace       - gpu
@@ -181,8 +182,8 @@ public class TestFileSystemNodeAttributeStore {
     Assert.assertEquals("host1 size", 2,
         mgr.getAttributesForNode("host1").size());
     attrs = mgr.getAttributesForNode("host0");
-    Assert.assertEquals(attrs.size(), 1);
-    Assert.assertEquals(attrs.keySet().toArray()[0], gpu);
+    assertThat(attrs).hasSize(1);
+    assertThat(attrs.keySet().toArray()[0]).isEqualTo(gpu);
     attrs = mgr.getAttributesForNode("host1");
     Assert.assertTrue(attrs.keySet().contains(docker));
     Assert.assertTrue(attrs.keySet().contains(gpu));
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestRMNodeLabelsManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestRMNodeLabelsManager.java
index 1da6f93..5c9b073 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestRMNodeLabelsManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/TestRMNodeLabelsManager.java
@@ -17,6 +17,8 @@
  */
 
 package org.apache.hadoop.yarn.server.resourcemanager.nodelabels;
+
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -88,37 +90,37 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
     mgr.replaceLabelsOnNode(ImmutableMap.of(toNodeId("n1"), toSet("p1"),
         toNodeId("n2"), toSet("p2"), toNodeId("n3"), toSet("p3")));
 
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null), EMPTY_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel("p2", null), EMPTY_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel("p3", null), EMPTY_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null),
-        EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p2", null)).isEqualTo(EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p3", null)).isEqualTo(EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null)).
+        isEqualTo(EMPTY_RESOURCE);
 
     // active two NM to n1, one large and one small
     mgr.activateNode(NodeId.newInstance("n1", 1), SMALL_RESOURCE);
     mgr.activateNode(NodeId.newInstance("n1", 2), LARGE_NODE);
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(
         Resources.add(SMALL_RESOURCE, LARGE_NODE));
 
     // check add labels multiple times shouldn't overwrite
     // original attributes on labels like resource
     mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p1", "p4"));
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(
         Resources.add(SMALL_RESOURCE, LARGE_NODE));
     Assert.assertEquals(mgr.getResourceByLabel("p4", null), EMPTY_RESOURCE);
 
     // change the large NM to small, check if resource updated
     mgr.updateNodeResource(NodeId.newInstance("n1", 2), SMALL_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
 
     // deactive one NM, and check if resource updated
     mgr.deactivateNode(NodeId.newInstance("n1", 1));
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null), SMALL_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(SMALL_RESOURCE);
 
     // continus deactive, check if resource updated
     mgr.deactivateNode(NodeId.newInstance("n1", 2));
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null), EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(EMPTY_RESOURCE);
 
     // Add two NM to n1 back
     mgr.activateNode(NodeId.newInstance("n1", 1), SMALL_RESOURCE);
@@ -126,8 +128,8 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
 
     // And remove p1, now the two NM should come to default label,
     mgr.removeFromClusterNodeLabels(ImmutableSet.of("p1"));
-    Assert.assertEquals(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null),
-        Resources.add(SMALL_RESOURCE, LARGE_NODE));
+    assertThat(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null)).
+        isEqualTo(Resources.add(SMALL_RESOURCE, LARGE_NODE));
   }
   
   @Test(timeout = 5000)
@@ -152,10 +154,10 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
 
     // change label of n1 to p2
     mgr.replaceLabelsOnNode(ImmutableMap.of(toNodeId("n1"), toSet("p2")));
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null), EMPTY_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel("p2", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(EMPTY_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p2", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
-    Assert.assertEquals(mgr.getResourceByLabel("p3", null), SMALL_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p3", null)).isEqualTo(SMALL_RESOURCE);
 
     // add more labels
     mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p4", "p5", "p6"));
@@ -180,17 +182,17 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
     mgr.activateNode(NodeId.newInstance("n9", 1), SMALL_RESOURCE);
 
     // check varibles
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null), SMALL_RESOURCE);
-    Assert.assertEquals(mgr.getResourceByLabel("p2", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(SMALL_RESOURCE);
+    assertThat(mgr.getResourceByLabel("p2", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 3));
-    Assert.assertEquals(mgr.getResourceByLabel("p3", null),
+    assertThat(mgr.getResourceByLabel("p3", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
-    Assert.assertEquals(mgr.getResourceByLabel("p4", null),
+    assertThat(mgr.getResourceByLabel("p4", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 1));
-    Assert.assertEquals(mgr.getResourceByLabel("p5", null),
-        Resources.multiply(SMALL_RESOURCE, 1));
-    Assert.assertEquals(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null),
+    assertThat(mgr.getResourceByLabel("p5", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 1));
+    assertThat(mgr.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, null)).
+        isEqualTo(Resources.multiply(SMALL_RESOURCE, 1));
 
     // change a bunch of nodes -> labels
     // n4 -> p2
@@ -212,17 +214,17 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
         toNodeId("n9"), toSet("p1")));
 
     // check varibles
-    Assert.assertEquals(mgr.getResourceByLabel("p1", null),
+    assertThat(mgr.getResourceByLabel("p1", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
-    Assert.assertEquals(mgr.getResourceByLabel("p2", null),
+    assertThat(mgr.getResourceByLabel("p2", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 3));
-    Assert.assertEquals(mgr.getResourceByLabel("p3", null),
+    assertThat(mgr.getResourceByLabel("p3", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
-    Assert.assertEquals(mgr.getResourceByLabel("p4", null),
+    assertThat(mgr.getResourceByLabel("p4", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 0));
-    Assert.assertEquals(mgr.getResourceByLabel("p5", null),
+    assertThat(mgr.getResourceByLabel("p5", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 0));
-    Assert.assertEquals(mgr.getResourceByLabel("", null),
+    assertThat(mgr.getResourceByLabel("", null)).isEqualTo(
         Resources.multiply(SMALL_RESOURCE, 2));
   }
   
@@ -413,9 +415,9 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
     mgr.activateNode(NodeId.newInstance("n1", 4), SMALL_RESOURCE);
     
     // check resource of no label, it should be small * 4
-    Assert.assertEquals(
-        mgr.getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, null),
-        Resources.multiply(SMALL_RESOURCE, 4));
+    assertThat(
+        mgr.getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, null)).
+        isEqualTo(Resources.multiply(SMALL_RESOURCE, 4));
     
     // change two of these nodes to p1, check resource of no_label and P1
     mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p1"));
@@ -423,12 +425,12 @@ public class TestRMNodeLabelsManager extends NodeLabelTestBase {
         toNodeId("n1:2"), toSet("p1")));
     
     // check resource
-    Assert.assertEquals(
-        mgr.getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, null),
-        Resources.multiply(SMALL_RESOURCE, 2));    
-    Assert.assertEquals(
-            mgr.getResourceByLabel("p1", null),
-            Resources.multiply(SMALL_RESOURCE, 2));
+    assertThat(
+        mgr.getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, null)).
+        isEqualTo(Resources.multiply(SMALL_RESOURCE, 2));
+    assertThat(
+        mgr.getResourceByLabel("p1", null)).isEqualTo(
+        Resources.multiply(SMALL_RESOURCE, 2));
   }
 
   @Test(timeout = 5000)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestFSRMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestFSRMStateStore.java
index cd2a0fa..13faff0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestFSRMStateStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestFSRMStateStore.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.recovery;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
@@ -125,8 +126,8 @@ public class TestFSRMStateStore extends RMStateStoreTestBase {
           YarnConfiguration.YARN_INTERMEDIATE_DATA_ENCRYPTION, true);
       }
       this.store = new TestFileSystemRMStore(conf);
-      Assert.assertEquals(store.getNumRetries(), 8);
-      Assert.assertEquals(store.getRetryInterval(), 900L);
+      assertThat(store.getNumRetries()).isEqualTo(8);
+      assertThat(store.getRetryInterval()).isEqualTo(900L);
       Assert.assertTrue(store.fs.getConf() == store.fsConf);
       FileSystem previousFs = store.fs;
       store.startInternal();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java
index 23c2b9a..f21ff96 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java
@@ -76,6 +76,7 @@ import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -435,14 +436,14 @@ public class TestZKRMStateStore extends RMStateStoreTestBase {
     rm.getRMContext().getRMAdminService().transitionToActive(req);
     ZKRMStateStore stateStore = (ZKRMStateStore) rm.getRMContext().getStateStore();
     List<ACL> acls = stateStore.getACL(rootPath);
-    assertEquals(acls.size(), 2);
+    assertThat(acls).hasSize(2);
     // CREATE and DELETE permissions for root node based on RM ID
     verifyZKACL("digest", "localhost", Perms.CREATE | Perms.DELETE, acls);
     verifyZKACL(
         "world", "anyone", Perms.ALL ^ (Perms.CREATE | Perms.DELETE), acls);
 
     acls = stateStore.getACL(parentPath);
-    assertEquals(1, acls.size());
+    assertThat(acls).hasSize(1);
     assertEquals(perm, acls.get(0).getPerms());
     rm.close();
 
@@ -463,7 +464,7 @@ public class TestZKRMStateStore extends RMStateStoreTestBase {
     rm.start();
     rm.getRMContext().getRMAdminService().transitionToActive(req);
     acls = stateStore.getACL(rootPath);
-    assertEquals(acls.size(), 2);
+    assertThat(acls).hasSize(2);
     verifyZKACL("digest", "localhost", Perms.CREATE | Perms.DELETE, acls);
     verifyZKACL(
         "world", "anyone", Perms.ALL ^ (Perms.CREATE | Perms.DELETE), acls);
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/TestReservationSystemUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/TestReservationSystemUtil.java
index d383bac..a092e0d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/TestReservationSystemUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/TestReservationSystemUtil.java
@@ -17,6 +17,7 @@
  *******************************************************************************/
 package org.apache.hadoop.yarn.server.resourcemanager.reservation;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
 import org.apache.hadoop.yarn.api.records.ReservationAllocationState;
@@ -49,9 +50,9 @@ public class TestReservationSystemUtil {
             .convertAllocationsToReservationInfo(
               Collections.singleton(allocation), true);
 
-    Assert.assertEquals(infoList.size(), 1);
-    Assert.assertEquals(infoList.get(0).getReservationId().toString(),
-            id.toString());
+    assertThat(infoList).hasSize(1);
+    assertThat(infoList.get(0).getReservationId().toString()).isEqualTo(
+        id.toString());
     Assert.assertFalse(infoList.get(0).getResourceAllocationRequests()
             .isEmpty());
   }
@@ -104,7 +105,7 @@ public class TestReservationSystemUtil {
             .convertAllocationsToReservationInfo(
                     Collections.<ReservationAllocation>emptySet(), false);
 
-    Assert.assertEquals(infoList.size(), 0);
+    assertThat(infoList).isEmpty();
   }
 
   private ReservationAllocation createReservationAllocation(long startTime,
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/TestAlignedPlanner.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/TestAlignedPlanner.java
index 9fa8559..e26f945 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/TestAlignedPlanner.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/TestAlignedPlanner.java
@@ -18,7 +18,8 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.reservation.planning;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.within;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -990,8 +991,9 @@ public class TestAlignedPlanner {
         StageAllocatorLowCostAligned.getDurationInterval(10*step, 30*step,
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
-    assertEquals(durationInterval.numCanFit(), 4);
-    assertEquals(durationInterval.getTotalCost(), 0.55, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(4);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0.55, within(0.00001));
 
     // 2.
     // currLoad: should start at 20*step, end at 31*step with a null value
@@ -1003,8 +1005,9 @@ public class TestAlignedPlanner {
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
     System.out.println(durationInterval);
-    assertEquals(durationInterval.numCanFit(), 3);
-    assertEquals(durationInterval.getTotalCost(), 0.56, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(3);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0.56, within(0.00001));
 
     // 3.
     // currLoad: should start at 20*step, end at 30*step with a null value
@@ -1015,8 +1018,9 @@ public class TestAlignedPlanner {
         StageAllocatorLowCostAligned.getDurationInterval(15*step, 30*step,
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
-    assertEquals(durationInterval.numCanFit(), 4);
-    assertEquals(durationInterval.getTotalCost(), 0.55, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(4);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0.55, within(0.00001));
 
     // 4.
     // currLoad: should start at 20*step, end at 31*step with a null value
@@ -1028,8 +1032,9 @@ public class TestAlignedPlanner {
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
     System.out.println(durationInterval);
-    assertEquals(durationInterval.numCanFit(), 3);
-    assertEquals(durationInterval.getTotalCost(), 0.56, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(3);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0.56, within(0.00001));
 
     // 5.
     // currLoad: should only contain one entry at startTime
@@ -1042,8 +1047,9 @@ public class TestAlignedPlanner {
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
     System.out.println(durationInterval);
-    assertEquals(durationInterval.numCanFit(), 8);
-    assertEquals(durationInterval.getTotalCost(), 0.05, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(8);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0.05, within(0.00001));
 
     // 6.
     // currLoad: should start at 39*step, end at 41*step with a null value
@@ -1055,8 +1061,9 @@ public class TestAlignedPlanner {
             planLoads, planModifications, clusterCapacity, netRLERes, res, step,
             requestedResources);
     System.out.println(durationInterval);
-    assertEquals(durationInterval.numCanFit(), 0);
-    assertEquals(durationInterval.getTotalCost(), 0, 0.00001);
+    assertThat(durationInterval.numCanFit()).isEqualTo(0);
+    assertThat(durationInterval.getTotalCost()).
+        isCloseTo(0, within(0.00001));
 
   }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/TestRMAppTransitions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/TestRMAppTransitions.java
index dc189c1..e5d7e3f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/TestRMAppTransitions.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/TestRMAppTransitions.java
@@ -105,6 +105,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import static org.assertj.core.api.Assertions.assertThat;
 import static junit.framework.TestCase.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
@@ -1278,7 +1279,8 @@ public class TestRMAppTransitions {
     assertAppState(RMAppState.NEW, app);
     ApplicationReport report = app.createAndGetApplicationReport(null, true);
     Assert.assertNotNull(report.getApplicationResourceUsageReport());
-    Assert.assertEquals(report.getApplicationResourceUsageReport(),RMServerUtils.DUMMY_APPLICATION_RESOURCE_USAGE_REPORT);
+    assertThat(report.getApplicationResourceUsageReport()).
+        isEqualTo(RMServerUtils.DUMMY_APPLICATION_RESOURCE_USAGE_REPORT);
     report = app.createAndGetApplicationReport("clientuser", true);
     Assert.assertNotNull(report.getApplicationResourceUsageReport());
     Assert.assertTrue("bad proxy url for app",
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
index 6958182..172db0a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -308,14 +309,15 @@ public class TestApplicationLimits {
     		queue.getUserAMResourceLimit());
     
     Resource amResourceLimit = Resource.newInstance(160 * GB, 1);
-    assertEquals(queue.calculateAndGetAMResourceLimit(), amResourceLimit);
-    assertEquals(queue.getUserAMResourceLimit(), 
+    assertThat(queue.calculateAndGetAMResourceLimit()).
+        isEqualTo(amResourceLimit);
+    assertThat(queue.getUserAMResourceLimit()).isEqualTo(
       Resource.newInstance(80*GB, 1));
     
     // Assert in metrics
-    assertEquals(queue.getMetrics().getAMResourceLimitMB(),
+    assertThat(queue.getMetrics().getAMResourceLimitMB()).isEqualTo(
         amResourceLimit.getMemorySize());
-    assertEquals(queue.getMetrics().getAMResourceLimitVCores(),
+    assertThat(queue.getMetrics().getAMResourceLimitVCores()).isEqualTo(
         amResourceLimit.getVirtualCores());
 
     assertEquals(
@@ -327,11 +329,11 @@ public class TestApplicationLimits {
     clusterResource = Resources.createResource(120 * 16 * GB);
     root.updateClusterResource(clusterResource, new ResourceLimits(
         clusterResource));
-    
-    assertEquals(queue.calculateAndGetAMResourceLimit(),
+
+    assertThat(queue.calculateAndGetAMResourceLimit()).isEqualTo(
         Resource.newInstance(192 * GB, 1));
-    assertEquals(queue.getUserAMResourceLimit(), 
-      Resource.newInstance(96*GB, 1));
+    assertThat(queue.getUserAMResourceLimit()).isEqualTo(
+        Resource.newInstance(96*GB, 1));
     
     assertEquals(
         (int)(clusterResource.getMemorySize() * queue.getAbsoluteCapacity()),
@@ -378,11 +380,11 @@ public class TestApplicationLimits {
         (long) csConf.getMaximumApplicationMasterResourcePerQueuePercent(
           queue.getQueuePath())
         );
-    
-    assertEquals(queue.calculateAndGetAMResourceLimit(),
+
+    assertThat(queue.calculateAndGetAMResourceLimit()).isEqualTo(
         Resource.newInstance(800 * GB, 1));
-    assertEquals(queue.getUserAMResourceLimit(), 
-      Resource.newInstance(400*GB, 1));
+    assertThat(queue.getUserAMResourceLimit()).isEqualTo(
+        Resource.newInstance(400*GB, 1));
 
     // Change the per-queue max applications.
     csConf.setInt(PREFIX + queue.getQueuePath() + ".maximum-applications",
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationPriority.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationPriority.java
index cad0151..fea82e5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationPriority.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationPriority.java
@@ -18,7 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -140,9 +140,9 @@ public class TestApplicationPriority {
 
     // Now, the first assignment will be for app2 since app2 is of highest
     // priority
-    assertEquals(q.getApplications().size(), 2);
-    assertEquals(q.getApplications().iterator().next()
-        .getApplicationAttemptId(), appAttemptId2);
+    assertThat(q.getApplications()).hasSize(2);
+    assertThat(q.getApplications().iterator().next().getApplicationAttemptId())
+        .isEqualTo(appAttemptId2);
 
     rm.stop();
   }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
index fd8fa05..ae4009a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAXIMUM_ALLOCATION;
 import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAXIMUM_ALLOCATION_MB;
 import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAXIMUM_ALLOCATION_VCORES;
@@ -5251,7 +5252,8 @@ public class TestCapacityScheduler extends CapacitySchedulerTestBase {
     RMNode node1 = rm.getRMContext().getRMNodes().get(nm1.getNodeId());
     cs.handle(new NodeUpdateSchedulerEvent(node1));
     ContainerId cid = ContainerId.newContainerId(am.getApplicationAttemptId(), 1l);
-    Assert.assertEquals(cs.getRMContainer(cid).getState(), RMContainerState.ACQUIRED);
+    assertThat(cs.getRMContainer(cid).getState()).
+        isEqualTo(RMContainerState.ACQUIRED);
     cid = ContainerId.newContainerId(am.getApplicationAttemptId(), 2l);
     Assert.assertNull(cs.getRMContainer(cid));
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestConfigurableResource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestConfigurableResource.java
index 249d1f7..debd8ae 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestConfigurableResource.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestConfigurableResource.java
@@ -22,6 +22,7 @@ import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.util.resource.Resources;
 import org.junit.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
@@ -52,8 +53,10 @@ public class TestConfigurableResource {
   public void testGetResourceWithAbsolute() {
     ConfigurableResource configurableResource =
         new ConfigurableResource(Resources.createResource(3072, 3));
-    assertEquals(configurableResource.getResource().getMemorySize(), 3072);
-    assertEquals(configurableResource.getResource().getVirtualCores(), 3);
+    assertThat(configurableResource.getResource().getMemorySize()).
+        isEqualTo(3072);
+    assertThat(configurableResource.getResource().getVirtualCores()).
+        isEqualTo(3);
 
     assertEquals(
         configurableResource.getResource(clusterResource).getMemorySize(),
@@ -62,7 +65,9 @@ public class TestConfigurableResource {
         configurableResource.getResource(clusterResource).getVirtualCores(),
         3);
 
-    assertEquals(configurableResource.getResource(null).getMemorySize(), 3072);
-    assertEquals(configurableResource.getResource(null).getVirtualCores(), 3);
+    assertThat(configurableResource.getResource(null).getMemorySize()).
+        isEqualTo(3072);
+    assertThat(configurableResource.getResource(null).getVirtualCores()).
+        isEqualTo(3);
   }
 }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
index 81500db..5dac862 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
@@ -43,6 +43,7 @@ import org.apache.hadoop.yarn.util.ControlledClock;
 import org.apache.hadoop.yarn.util.resource.Resources;
 import org.junit.After;
 import org.junit.Assert;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
@@ -153,9 +154,10 @@ public class TestContinuousScheduling extends FairSchedulerTestBase {
     scheduler.handle(nodeEvent2);
 
     // available resource
-    Assert.assertEquals(scheduler.getClusterResource().getMemorySize(),
-        16 * 1024);
-    Assert.assertEquals(scheduler.getClusterResource().getVirtualCores(), 16);
+    assertThat(scheduler.getClusterResource().getMemorySize()).
+        isEqualTo(16 * 1024);
+    assertThat(scheduler.getClusterResource().getVirtualCores()).
+        isEqualTo(16);
 
     // send application request
     ApplicationAttemptId appAttemptId =
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
index 0cf1a7b..9c47b6b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
@@ -90,8 +91,9 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
     String queueName = "root.queue1";
     FSLeafQueue schedulable = new FSLeafQueue(queueName, scheduler, null);
     schedulable.setMaxShare(new ConfigurableResource(maxResource));
-    assertEquals(schedulable.getMetrics().getMaxApps(), Integer.MAX_VALUE);
-    assertEquals(schedulable.getMetrics().getSchedulingPolicy(),
+    assertThat(schedulable.getMetrics().getMaxApps()).
+        isEqualTo(Integer.MAX_VALUE);
+    assertThat(schedulable.getMetrics().getSchedulingPolicy()).isEqualTo(
         SchedulingPolicy.DEFAULT_POLICY.getName());
 
     FSAppAttempt app = mock(FSAppAttempt.class);
@@ -124,8 +126,8 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
     resourceManager.start();
     scheduler = (FairScheduler) resourceManager.getResourceScheduler();
     for(FSQueue queue: scheduler.getQueueManager().getQueues()) {
-      assertEquals(queue.getMetrics().getMaxApps(), Integer.MAX_VALUE);
-      assertEquals(queue.getMetrics().getSchedulingPolicy(),
+      assertThat(queue.getMetrics().getMaxApps()).isEqualTo(Integer.MAX_VALUE);
+      assertThat(queue.getMetrics().getSchedulingPolicy()).isEqualTo(
           SchedulingPolicy.DEFAULT_POLICY.getName());
     }
 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
index e76e7e3..d9f29f1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
@@ -114,6 +114,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.conf.YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -4623,17 +4624,17 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     FSQueue queue2 = queueMgr.getLeafQueue("parent2.queue2", true);
     FSQueue queue1 = queueMgr.getLeafQueue("parent1.queue1", true);
 
-    Assert.assertEquals(parent2.getResourceUsage().getMemorySize(), 0);
-    Assert.assertEquals(queue2.getResourceUsage().getMemorySize(), 0);
-    Assert.assertEquals(parent1.getResourceUsage().getMemorySize(), 1 * GB);
-    Assert.assertEquals(queue1.getResourceUsage().getMemorySize(), 1 * GB);
+    assertThat(parent2.getResourceUsage().getMemorySize()).isEqualTo(0);
+    assertThat(queue2.getResourceUsage().getMemorySize()).isEqualTo(0);
+    assertThat(parent1.getResourceUsage().getMemorySize()).isEqualTo(1 * GB);
+    assertThat(queue1.getResourceUsage().getMemorySize()).isEqualTo(1 * GB);
 
     scheduler.moveApplication(appAttId.getApplicationId(), "parent2.queue2");
 
-    Assert.assertEquals(parent2.getResourceUsage().getMemorySize(), 1 * GB);
-    Assert.assertEquals(queue2.getResourceUsage().getMemorySize(), 1 * GB);
-    Assert.assertEquals(parent1.getResourceUsage().getMemorySize(), 0);
-    Assert.assertEquals(queue1.getResourceUsage().getMemorySize(), 0);
+    assertThat(parent2.getResourceUsage().getMemorySize()).isEqualTo(1 * GB);
+    assertThat(queue2.getResourceUsage().getMemorySize()).isEqualTo(1 * GB);
+    assertThat(parent1.getResourceUsage().getMemorySize()).isEqualTo(0);
+    assertThat(queue1.getResourceUsage().getMemorySize()).isEqualTo(0);
   }
     
   @Test (expected = YarnException.class)
@@ -5070,20 +5071,20 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     Resource usedResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getAllocatedResource();
-    Assert.assertEquals(usedResource.getMemorySize(), 0);
-    Assert.assertEquals(usedResource.getVirtualCores(), 0);
+    assertThat(usedResource.getMemorySize()).isEqualTo(0);
+    assertThat(usedResource.getVirtualCores()).isEqualTo(0);
     // Check total resource of scheduler node is also changed to 0 GB 0 core
     Resource totalResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getTotalResource();
-    Assert.assertEquals(totalResource.getMemorySize(), 0 * GB);
-    Assert.assertEquals(totalResource.getVirtualCores(), 0);
+    assertThat(totalResource.getMemorySize()).isEqualTo(0 * GB);
+    assertThat(totalResource.getVirtualCores()).isEqualTo(0);
     // Check the available resource is 0/0
     Resource availableResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getUnallocatedResource();
-    Assert.assertEquals(availableResource.getMemorySize(), 0);
-    Assert.assertEquals(availableResource.getVirtualCores(), 0);
+    assertThat(availableResource.getMemorySize()).isEqualTo(0);
+    assertThat(availableResource.getVirtualCores()).isEqualTo(0);
   }
 
   private NodeManager registerNode(String hostName, int containerManagerPort,
@@ -5159,8 +5160,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // container will be allocated at node2
     scheduler.handle(new NodeUpdateSchedulerEvent(node2));
-    assertEquals(scheduler.getSchedulerApp(app2).
-        getLiveContainers().size(), 1);
+    assertThat(scheduler.getSchedulerApp(app2).getLiveContainers()).hasSize(1);
 
     long maxId = 0;
     for (RMContainer container :
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
index f9093c1..dc94e5e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -333,7 +334,7 @@ public class TestFifoScheduler {
     NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node0);
     scheduler.handle(nodeEvent1);
     
-    assertEquals(scheduler.getNumClusterNodes(), 1);
+    assertThat(scheduler.getNumClusterNodes()).isEqualTo(1);
     
     Resource newResource = Resources.createResource(1024, 4);
     
@@ -1286,20 +1287,20 @@ public class TestFifoScheduler {
     Resource usedResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getAllocatedResource();
-    Assert.assertEquals(usedResource.getMemorySize(), 1 * GB);
-    Assert.assertEquals(usedResource.getVirtualCores(), 1);
+    assertThat(usedResource.getMemorySize()).isEqualTo(1 * GB);
+    assertThat(usedResource.getVirtualCores()).isEqualTo(1);
     // Check total resource of scheduler node is also changed to 1 GB 1 core
     Resource totalResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getTotalResource();
-    Assert.assertEquals(totalResource.getMemorySize(), 1 * GB);
-    Assert.assertEquals(totalResource.getVirtualCores(), 1);
+    assertThat(totalResource.getMemorySize()).isEqualTo(1 * GB);
+    assertThat(totalResource.getVirtualCores()).isEqualTo(1);
     // Check the available resource is 0/0
     Resource availableResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getUnallocatedResource();
-    Assert.assertEquals(availableResource.getMemorySize(), 0);
-    Assert.assertEquals(availableResource.getVirtualCores(), 0);
+    assertThat(availableResource.getMemorySize()).isEqualTo(0);
+    assertThat(availableResource.getVirtualCores()).isEqualTo(0);
   }
 
   private void checkApplicationResourceUsage(int expected, 
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicy.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicy.java
index 447618f4..776f6c6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicy.java
@@ -25,6 +25,8 @@ import org.junit.Test;
 
 import org.apache.hadoop.yarn.api.records.Priority;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 public class TestFifoOrderingPolicy {
   
   @Test
@@ -33,14 +35,14 @@ public class TestFifoOrderingPolicy {
       new FifoOrderingPolicy<MockSchedulableEntity>();
     MockSchedulableEntity r1 = new MockSchedulableEntity();
     MockSchedulableEntity r2 = new MockSchedulableEntity();
-    
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), 0);
+
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(0);
     
     r1.setSerial(1);
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), 1);
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(1);
     
     r2.setSerial(2);
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), -1);
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(-1);
   }
   
   @Test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicyForPendingApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicyForPendingApps.java
index befa8e6..5fa9a1d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicyForPendingApps.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/TestFifoOrderingPolicyForPendingApps.java
@@ -23,6 +23,8 @@ import java.util.*;
 import org.junit.Assert;
 import org.junit.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 public class TestFifoOrderingPolicyForPendingApps {
 
   @Test
@@ -33,16 +35,16 @@ public class TestFifoOrderingPolicyForPendingApps {
     MockSchedulableEntity r1 = new MockSchedulableEntity();
     MockSchedulableEntity r2 = new MockSchedulableEntity();
 
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), 0);
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(0);
 
     r1.setSerial(1);
     r1.setRecovering(true);
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), -1);
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(-1);
 
     r1.setRecovering(false);
     r2.setSerial(2);
     r2.setRecovering(true);
-    Assert.assertEquals(policy.getComparator().compare(r1, r2), 1);
+    assertThat(policy.getComparator().compare(r1, r2)).isEqualTo(1);
   }
 
   /**
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/volume/csi/TestVolumeProcessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/volume/csi/TestVolumeProcessor.java
index 5113ba5..370c527 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/volume/csi/TestVolumeProcessor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/volume/csi/TestVolumeProcessor.java
@@ -64,6 +64,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -316,13 +317,13 @@ public class TestVolumeProcessor {
 
     Assert.assertEquals(1, allocated.size());
     Container alloc = allocated.get(0);
-    Assert.assertEquals(alloc.getResource().getMemorySize(), 1024);
-    Assert.assertEquals(alloc.getResource().getVirtualCores(), 1);
+    assertThat(alloc.getResource().getMemorySize()).isEqualTo(1024);
+    assertThat(alloc.getResource().getVirtualCores()).isEqualTo(1);
     ResourceInformation allocatedVolume =
         alloc.getResource().getResourceInformation(VOLUME_RESOURCE_NAME);
     Assert.assertNotNull(allocatedVolume);
-    Assert.assertEquals(allocatedVolume.getValue(), 1024);
-    Assert.assertEquals(allocatedVolume.getUnits(), "Mi");
+    assertThat(allocatedVolume.getValue()).isEqualTo(1024);
+    assertThat(allocatedVolume.getUnits()).isEqualTo("Mi");
     rm.stop();
   }
 }
\ No newline at end of file
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
index e8f62d0..c3f41f6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -1088,8 +1089,8 @@ public class TestRMWebServicesNodes extends JerseyTestBase {
       for (int j=0; j<tagsInfo.length(); j++) {
         JSONObject tagInfo = tagsInfo.getJSONObject(j);
         String expectedTag = it.next();
-        assertEquals(tagInfo.getString("allocationTag"), expectedTag);
-        assertEquals(tagInfo.getLong("allocationsCount"),
+        assertThat(tagInfo.getString("allocationTag")).isEqualTo(expectedTag);
+        assertThat(tagInfo.getLong("allocationsCount")).isEqualTo(
             expectedTags.get(expectedTag).longValue());
       }
     }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
index 7e8ba88..adf6d7c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -770,7 +771,7 @@ public class TestRMWebServicesReservation extends JerseyTestBase {
       return;
     }
 
-    assertEquals(json.getJSONArray("reservations").length(), 2);
+    assertThat(json.getJSONArray("reservations").length()).isEqualTo(2);
 
     testRDLHelper(json.getJSONArray("reservations").getJSONObject(0));
     testRDLHelper(json.getJSONArray("reservations").getJSONObject(1));
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/pom.xml
index 9891e0a..105d59c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/pom.xml
@@ -125,6 +125,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
     </dependency>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestEntityGroupFSTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestEntityGroupFSTimelineStore.java
index 61da3c8..6435416 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestEntityGroupFSTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestEntityGroupFSTimelineStore.java
@@ -60,6 +60,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
@@ -414,7 +415,7 @@ public class TestEntityGroupFSTimelineStore extends TimelineStoreTestUtils {
     TimelineEntities entities = tdm.getEntities("type_1", null, null, null,
         null, null, null, null, EnumSet.allOf(TimelineReader.Field.class),
         UserGroupInformation.getLoginUser());
-    assertEquals(entities.getEntities().size(), 1);
+    assertThat(entities.getEntities()).hasSize(1);
     for (TimelineEntity entity : entities.getEntities()) {
       assertEquals((Long) 123L, entity.getStartTime());
     }
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
index 01eeec9..43021d3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/pom.xml
@@ -325,6 +325,12 @@
     </dependency>
 
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-testing-util</artifactId>
       <scope>test</scope>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRunCompaction.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRunCompaction.java
index e0a58da..475cb7a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRunCompaction.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRunCompaction.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.timelineservice.storage.flow;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
@@ -119,7 +120,8 @@ public class TestHBaseStorageFlowRunCompaction {
     Cell actualValue = r.getColumnLatestCell(
         FlowRunColumnFamily.INFO.getBytes(), columnNameBytes);
     assertNotNull(CellUtil.cloneValue(actualValue));
-    assertEquals(Bytes.toString(CellUtil.cloneValue(actualValue)), value);
+    assertThat(Bytes.toString(CellUtil.cloneValue(actualValue))).
+        isEqualTo(value);
   }
 
   @Test
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
index 81ee6e2..7293a06 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/pom.xml
@@ -132,6 +132,12 @@
     </dependency>
 
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/collector/TestTimelineCollector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/collector/TestTimelineCollector.java
index 8051792..766c2cd 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/collector/TestTimelineCollector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/collector/TestTimelineCollector.java
@@ -42,6 +42,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -109,7 +110,7 @@ public class TestTimelineCollector {
     TimelineEntities testEntities = generateTestEntities(groups, n);
     TimelineEntity resultEntity = TimelineCollector.aggregateEntities(
         testEntities, "test_result", "TEST_AGGR", true);
-    assertEquals(resultEntity.getMetrics().size(), groups * 3);
+    assertThat(resultEntity.getMetrics()).hasSize(groups * 3);
 
     for (int i = 0; i < groups; i++) {
       Set<TimelineMetric> metrics = resultEntity.getMetrics();
@@ -130,7 +131,7 @@ public class TestTimelineCollector {
     TimelineEntities testEntities1 = generateTestEntities(1, n);
     TimelineEntity resultEntity1 = TimelineCollector.aggregateEntities(
         testEntities1, "test_result", "TEST_AGGR", false);
-    assertEquals(resultEntity1.getMetrics().size(), 3);
+    assertThat(resultEntity1.getMetrics()).hasSize(3);
 
     Set<TimelineMetric> metrics = resultEntity1.getMetrics();
     for (TimelineMetric m : metrics) {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
index 8eaa24b..17715a5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/pom.xml
@@ -74,6 +74,11 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
     <dependency>
       <groupId>org.apache.hadoop</groupId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
index f04bc9a..6cc1d22 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.webproxy;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -334,7 +335,7 @@ public class TestWebAppProxyServlet {
           "Access-Control-Request-Headers", "Authorization");
       proxyConn.addRequestProperty(UNKNOWN_HEADER, "unknown");
       // Verify if four headers mentioned above have been added
-      assertEquals(proxyConn.getRequestProperties().size(), 4);
+      assertThat(proxyConn.getRequestProperties()).hasSize(4);
       proxyConn.connect();
       assertEquals(HttpURLConnection.HTTP_OK, proxyConn.getResponseCode());
       // Verify if number of headers received by end server is 9.
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestAmFilter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestAmFilter.java
index 8b0c1a4..641c2bf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestAmFilter.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestAmFilter.java
@@ -44,6 +44,7 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertEquals;
@@ -163,7 +164,7 @@ public class TestAmFilter {
     spy.proxyUriBases.put(rm2, rm2Url);
     spy.rmUrls = new String[] { rm1, rm2 };
 
-    assertEquals(spy.findRedirectUrl(), rm1Url);
+    assertThat(spy.findRedirectUrl()).isEqualTo(rm1Url);
   }
 
   private String startHttpServer() throws Exception {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestSecureAmFilter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestSecureAmFilter.java
index e87b765..0a88243 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestSecureAmFilter.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/amfilter/TestSecureAmFilter.java
@@ -25,7 +25,7 @@ import java.util.Set;
 import java.util.HashSet;
 import java.util.HashMap;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -137,7 +137,7 @@ public class TestSecureAmFilter {
 
     assertTrue(spy.isValidUrl(rm1Url));
     assertFalse(spy.isValidUrl(rm2Url));
-    assertEquals(spy.findRedirectUrl(), rm1Url);
+    assertThat(spy.findRedirectUrl()).isEqualTo(rm1Url);
   }
 
   private String startSecureHttpServer() throws Exception {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message