View Javadoc
1   /*
2    * Copyright (c) 2006 JMockit developers
3    * This file is subject to the terms of the MIT license (see LICENSE.txt).
4    */
5   package mockit;
6   
7   /**
8    * Same as {@link Verifications}, but checking that invocations from code under test occur in the same order as the
9    * verified expectations.
10   *
11   * <pre>{@code
12   * // Exercise tested code.
13   * codeUnderTest.doSomething();
14   *
15   * // Now verify that the expected invocations occurred in a given order.
16   * new VerificationsInOrder() {{
17   *    <strong>mock1</strong>.firstExpectedMethod(anyInt); minTimes = 1;
18   *    <strong>mock2</strong>.secondExpectedMethod(1, "test"); maxTimes = 2;
19   *    <strong>MockedClass</strong>.finalMethod(anyString);
20   * }};
21   * }</pre>
22   *
23   * @see #VerificationsInOrder()
24   * @see <a href="http://jmockit.github.io/tutorial/Mocking.html#verificationInOrder" target="tutorial">Tutorial</a>
25   */
26  public class VerificationsInOrder extends Verifications {
27      /**
28       * Begins <em>in-order</em> verification on the mocked types/instances that were invoked while executing code under
29       * test.
30       */
31      protected VerificationsInOrder() {
32          super(true, (Object[]) null);
33      }
34  }