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.creation; 7 8 import org.junit.Test; 9 import org.mockito.Mock; 10 import org.mockitoutil.TestBase; 11 12 import java.util.List; 13 import java.util.Set; 14 15 import static org.junit.Assert.assertTrue; 16 import static org.mockito.Mockito.mock; 17 import static org.mockito.Mockito.when; 18 19 //see issue 191 20 public class ShouldAllowInlineMockCreationTest extends TestBase { 21 22 @Mock List list; 23 24 @Test shouldAllowInlineMockCreation()25 public void shouldAllowInlineMockCreation() { 26 when(list.get(0)).thenReturn(mock(Set.class)); 27 assertTrue(list.get(0) instanceof Set); 28 } 29 } 30