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 
      6 package org.mockitousage.bugs;
      7 
      8 import org.junit.Test;
      9 import org.mockitoutil.TestBase;
     10 
     11 import static org.mockito.Mockito.*;
     12 
     13 //see bug 116
     14 public class AIOOBExceptionWithAtLeastTest extends TestBase {
     15 
     16     interface IProgressMonitor {
     17         void beginTask(String s, int i);
     18         void worked(int i);
     19         void done();
     20     }
     21 
     22     @Test
     23     public void testCompleteProgress() throws Exception {
     24         IProgressMonitor progressMonitor = mock(IProgressMonitor.class);
     25 
     26         progressMonitor.beginTask("foo", 12);
     27         progressMonitor.worked(10);
     28         progressMonitor.done();
     29 
     30         verify(progressMonitor).beginTask(anyString(), anyInt());
     31         verify(progressMonitor, atLeastOnce()).worked(anyInt());
     32     }
     33 }
     34