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

Replace assertThat with assertTrue in MetricsAsserts

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment