You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/01/30 12:06:01 UTC

[isis] branch master updated: ISIS-2223: fixes regression from previous commit

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 5393e04  ISIS-2223: fixes regression from previous commit
5393e04 is described below

commit 5393e042b3620cc7b863a30d0c12b235e1dae6c9
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Jan 30 13:05:50 2020 +0100

    ISIS-2223: fixes regression from previous commit
---
 .../applib/core/jmocking/JUnitRuleMockery2.java           | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/core/jmocking/JUnitRuleMockery2.java b/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/core/jmocking/JUnitRuleMockery2.java
index f26adde..ccbef81 100644
--- a/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/core/jmocking/JUnitRuleMockery2.java
+++ b/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/core/jmocking/JUnitRuleMockery2.java
@@ -23,6 +23,7 @@ import java.lang.annotation.Target;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.util.List;
+import java.util.function.Consumer;
 
 import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
@@ -232,7 +233,7 @@ public class JUnitRuleMockery2 extends JUnit4Mockery implements MethodRule {
      * returned in turn.
      */
     public <T> T ignoring(final T mock) {
-        checking(expectationsWith(()->ignoring(mock)));
+        checking(expectationsWith(exp->exp.ignoring(mock)));
         return mock;
     }
 
@@ -241,7 +242,7 @@ public class JUnitRuleMockery2 extends JUnit4Mockery implements MethodRule {
      * turn.
      */
     public <T> T allowing(final T mock) {
-        checking(expectationsWith(()->allowing(mock)));
+        checking(expectationsWith(exp->exp.allowing(mock)));
         return mock;
     }
 
@@ -249,7 +250,7 @@ public class JUnitRuleMockery2 extends JUnit4Mockery implements MethodRule {
      * Prohibit any interaction with the mock.
      */
     public <T> T never(final T mock) {
-        checking(expectationsWith(()->never(mock)));
+        checking(expectationsWith(exp->exp.never(mock)));
         return mock;
     }
 
@@ -268,7 +269,7 @@ public class JUnitRuleMockery2 extends JUnit4Mockery implements MethodRule {
      * @return
      */
     public Object oneOf(final Object mock) {
-        checking(expectationsWith(()->oneOf(mock)));
+        checking(expectationsWith(exp->exp.oneOf(mock)));
         return mock;
     }
 
@@ -293,13 +294,13 @@ public class JUnitRuleMockery2 extends JUnit4Mockery implements MethodRule {
 
     
     private static class ExpectationsWithInitializer extends Expectations {
-        private ExpectationsWithInitializer(Runnable initializer) {
+        private ExpectationsWithInitializer(Consumer<Expectations> initializer) {
             super();
-            initializer.run();
+            initializer.accept(this);
         }
     }
     
-    public static Expectations expectationsWith(Runnable initializer) {
+    public static Expectations expectationsWith(Consumer<Expectations> initializer) {
         return new ExpectationsWithInitializer(initializer);
     }