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

Replace assertThat with assertTrue in MetricsAsserts

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.9.0, 3.0.0-alpha4
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: