Home | History | Annotate | Download | only in bugs
      1 /*
      2  * Copyright (c) 2007 Mockito contributors
      3  * This program is made available under the terms of the MIT License.
      4  */
      5 package org.mockitousage.bugs;
      6 
      7 
      8 import org.junit.Test;
      9 import org.mockito.listeners.InvocationListener;
     10 import org.mockito.listeners.MethodInvocationReport;
     11 
     12 import java.util.List;
     13 
     14 import static org.mockito.Mockito.*;
     15 
     16 public class ListenersLostOnResetMockTest {
     17 
     18     @Test
     19     public void listener() throws Exception {
     20         InvocationListener invocationListener = mock(InvocationListener.class);
     21 
     22         List mockedList = mock(List.class, withSettings().invocationListeners(invocationListener));
     23         reset(mockedList);
     24 
     25         mockedList.clear();
     26 
     27         verify(invocationListener).reportInvocation(any(MethodInvocationReport.class));
     28     }
     29 }
     30