1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 6 package org.mockitousage.bugs.varargs; 7 8 import org.junit.Test; 9 import org.mockitoutil.TestBase; 10 11 import static org.junit.Assert.assertEquals; 12 import static org.mockito.Mockito.*; 13 14 public class VarargsErrorWhenCallingRealMethodTest extends TestBase { 15 16 class Foo { 17 int blah(String a, String b, Object ... c) { 18 return 1; 19 } 20 } 21 22 @Test 23 public void shouldNotThrowAnyException() throws Exception { 24 Foo foo = mock(Foo.class); 25 26 when(foo.blah(anyString(), anyString())).thenCallRealMethod(); 27 28 assertEquals(1, foo.blah("foo", "bar")); 29 } 30 } 31