Browse Source

HADOOP-14218. Replace assertThat with assertTrue in MetricsAsserts.

Akira Ajisaka 8 years ago
parent
commit
448ec81fd7

+ 4 - 5
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java

@@ -27,7 +27,6 @@ import static org.mockito.AdditionalMatchers.geq;
 import static org.mockito.Mockito.*;
 
 import org.mockito.stubbing.Answer;
-import org.mockito.internal.matchers.GreaterThan;
 import org.mockito.invocation.InvocationOnMock;
 
 import org.mockito.ArgumentCaptor;
@@ -329,8 +328,8 @@ public class MetricsAsserts {
    */
   public static void assertCounterGt(String name, long greater,
                                      MetricsRecordBuilder rb) {
-    Assert.assertThat("Bad value for metric " + name, getLongCounter(name, rb),
-        new GreaterThan<Long>(greater));
+    Assert.assertTrue("Bad value for metric " + name,
+        getLongCounter(name, rb) > greater);
   }
 
   /**
@@ -352,8 +351,8 @@ public class MetricsAsserts {
    */
   public static void assertGaugeGt(String name, double greater,
                                    MetricsRecordBuilder rb) {
-    Assert.assertThat("Bad value for metric " + name, getDoubleGauge(name, rb),
-        new GreaterThan<Double>(greater));
+    Assert.assertTrue("Bad value for metric " + name,
+        getDoubleGauge(name, rb) > greater);
   }
 
   /**