View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
5    */
6   package mockit.internal.expectations.invocation;
7   
8   import static org.junit.jupiter.api.Assertions.assertEquals;
9   
10  import org.junit.jupiter.api.Test;
11  
12  final class InvocationErrorsTest {
13  
14      @Test
15      void missingInvocationToString() {
16          MissingInvocation error = new MissingInvocation("method myMethod() not invoked");
17          assertEquals("method myMethod() not invoked", error.toString());
18      }
19  
20      @Test
21      void unexpectedInvocationToString() {
22          UnexpectedInvocation error = new UnexpectedInvocation("unexpected call to doSomething()");
23          assertEquals("unexpected call to doSomething()", error.toString());
24      }
25  
26      @Test
27      void missingInvocationMessage() {
28          MissingInvocation error = new MissingInvocation("missing call");
29          assertEquals("missing call", error.getMessage());
30      }
31  
32      @Test
33      void unexpectedInvocationMessage() {
34          UnexpectedInvocation error = new UnexpectedInvocation("unexpected call");
35          assertEquals("unexpected call", error.getMessage());
36      }
37  }