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.internal.expectations.invocation;
6   
7   import edu.umd.cs.findbugs.annotations.NonNull;
8   
9   import mockit.internal.util.StackTrace;
10  
11  final class ExpectationError extends AssertionError {
12      private static final long serialVersionUID = 1L;
13      private String message;
14  
15      @NonNull
16      @Override
17      public String toString() {
18          return message;
19      }
20  
21      void defineCause(@NonNull String title, @NonNull Throwable error) {
22          message = title;
23          StackTrace.filterStackTrace(this);
24          error.initCause(this);
25      }
26  }