Skip to content

ArgumentCaptor A single capture() call captures all vararg elements. #585

@ChristianSchwarz

Description

@ChristianSchwarz

A single ArgumentCaptor.capture() call captures all vararg elements.

mock.varargs("1","2","3");

// captures "1","2","3"
verify(mock).varargs(c.capture()); 

// fails with arguments are different
verify(mock).varargs(c.capture(),
                               c.capture()); 


// captures "1","2","3"
verify(mock).varargs(c.capture(),
                               c.capture(),
                               c.capture()); 

Expected: One capture() call should only capture one vararg argument
Actual: A single ArgumentCaptor.capture() call captures all vararg elements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions