Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21232 Kerberos delegation token framework
  3. FLINK-27605

Upgrade mockito to a version where static function mocking is possible

    XMLWordPrintableJSON

Details

    Description

      There are some external APIs used by Flink which are designed in a way which is super hard to test.
      Such a pattern is when a class instance is only available through a static function and no publicly available constructor exists.
      A good example to this is "UserGroupInformation" class in Hadoop library.

      We've listed many different possibilities how to make it testable in the following place: https://github.com/apache/flink/pull/19372#discussion_r849691193
      After deep consideration we've agreed to use static function mocking in such exceptional cases in order to make code clean and maintainable.

      It should be emphasized that the general direction not changed in terms of Mockito and Powermock usage. It should be avoided as much as possible.

      Attachments

        Activity

          People

            gaborgsomogyi Gabor Somogyi
            gaborgsomogyi Gabor Somogyi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: