Uploaded image for project: 'Unitils'
  1. UNI-236

unitils-mock: argument matching does not correctly handle varargs arguments.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3
    • Fix Version/s: None
    • Component/s: mock
    • Labels:
      None

      Description

      Suppose following method should be mocked:

      public Object getSomething(int argument, String... otherArgs) {
      }

      you cannot use following method call for matching the mock invocation:

      mock.returns(value).getSomething(5);

      instead you have to use

      mock.returns(value).getSomething(5, null);


      This null varargs argument should not be required.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tim.ducheyne Tim Ducheyne
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: