Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14218

Replace assertThat with assertTrue in MetricsAsserts

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4
    • Component/s: None
    • Labels:
      None

      Description

      MetricsAsserts.java
        public static void assertCounterGt(String name, long greater,
                                           MetricsRecordBuilder rb) {
          Assert.assertThat("Bad value for metric " + name, getLongCounter(name, rb),
              new GreaterThan<Long>(greater));
        }
      

      The following code cannot be compiled with Mockito 2.1+ because it does not depend on org.hamcrest.Matcher anymore. We can simply replace this code with assertTrue(message, getLongCounter() > greater).

        Attachments

        1. HADOOP-14218.01.patch
          2 kB
          Akira Ajisaka

          Issue Links

            Activity

              People

              • Assignee:
                aajisaka Akira Ajisaka
                Reporter:
                aajisaka Akira Ajisaka
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: