Skip to content

Commit

Permalink
Merge pull request #122 from olibye/junit5
Browse files Browse the repository at this point in the history
Document Invocation.ExceptationMode and tidy imports
  • Loading branch information
olibye committed Feb 2, 2019
2 parents ddce923 + 8fec75b commit 1b3d8b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -14,7 +14,6 @@
import org.jmock.api.Invocation;
import org.jmock.api.Invokable;
import org.jmock.internal.SearchingClassLoader;
import org.jmock.internal.matcher.MethodMatcher;
import org.objenesis.Objenesis;
import org.objenesis.ObjenesisStd;

Expand Down
9 changes: 8 additions & 1 deletion jmock/src/main/java/org/jmock/api/Invocation.java
Expand Up @@ -41,8 +41,15 @@ public class Invocation implements SelfDescribing {
};


/**
* Support distinguish between building expectations and asserting against expectations.
* ByteBuddy (for example) checks runtime return types.
* It's simplest and safest to return null when building expectations
*/
public enum ExpectationMode {
BUILDING, ASSERTING, LEGACY
BUILDING, // We're building the expectations so invocations can return null
ASSERTING, // Return the default or specified reply
LEGACY // Legacy mode old imposters
}

public Invocation(ExpectationMode mode, Object invoked, Method method, Object... parameterValues) {
Expand Down
1 change: 0 additions & 1 deletion testjar/pom.xml
Expand Up @@ -22,7 +22,6 @@
<!-- Copy jar for unsigned tests -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy</id>
Expand Down

0 comments on commit 1b3d8b9

Please sign in to comment.