Check the input parameters with groovy.mock.interceptor












1















I'm trying to have some unit tests using groovy.mock.interceptor. I want to assert that a function was indeed called with some specific values as arguments. I can't find how to do that. Any help?



This is what it looks like:



import groovy.mock.interceptor.MockFor
import org.junit.Test

class MyClassTest extends GroovyTestCase {
@Test
void test_correctness_of_passed_arguments() {
def mock = new MockFor(MyClass)
mock.ignore('main')
mock.demand.myFunction{a, b, c -> '0'} // Is this where I should enforce the input params?
mock.use {
def foo = new MyClass()
foo.main() // <--- this is in there that it gets executed
}
mock.expect.verify()
mock.demand.recorded[0] // <--- can I get what has been passed afterwards?
}
}









share|improve this question





























    1















    I'm trying to have some unit tests using groovy.mock.interceptor. I want to assert that a function was indeed called with some specific values as arguments. I can't find how to do that. Any help?



    This is what it looks like:



    import groovy.mock.interceptor.MockFor
    import org.junit.Test

    class MyClassTest extends GroovyTestCase {
    @Test
    void test_correctness_of_passed_arguments() {
    def mock = new MockFor(MyClass)
    mock.ignore('main')
    mock.demand.myFunction{a, b, c -> '0'} // Is this where I should enforce the input params?
    mock.use {
    def foo = new MyClass()
    foo.main() // <--- this is in there that it gets executed
    }
    mock.expect.verify()
    mock.demand.recorded[0] // <--- can I get what has been passed afterwards?
    }
    }









    share|improve this question



























      1












      1








      1








      I'm trying to have some unit tests using groovy.mock.interceptor. I want to assert that a function was indeed called with some specific values as arguments. I can't find how to do that. Any help?



      This is what it looks like:



      import groovy.mock.interceptor.MockFor
      import org.junit.Test

      class MyClassTest extends GroovyTestCase {
      @Test
      void test_correctness_of_passed_arguments() {
      def mock = new MockFor(MyClass)
      mock.ignore('main')
      mock.demand.myFunction{a, b, c -> '0'} // Is this where I should enforce the input params?
      mock.use {
      def foo = new MyClass()
      foo.main() // <--- this is in there that it gets executed
      }
      mock.expect.verify()
      mock.demand.recorded[0] // <--- can I get what has been passed afterwards?
      }
      }









      share|improve this question
















      I'm trying to have some unit tests using groovy.mock.interceptor. I want to assert that a function was indeed called with some specific values as arguments. I can't find how to do that. Any help?



      This is what it looks like:



      import groovy.mock.interceptor.MockFor
      import org.junit.Test

      class MyClassTest extends GroovyTestCase {
      @Test
      void test_correctness_of_passed_arguments() {
      def mock = new MockFor(MyClass)
      mock.ignore('main')
      mock.demand.myFunction{a, b, c -> '0'} // Is this where I should enforce the input params?
      mock.use {
      def foo = new MyClass()
      foo.main() // <--- this is in there that it gets executed
      }
      mock.expect.verify()
      mock.demand.recorded[0] // <--- can I get what has been passed afterwards?
      }
      }






      unit-testing groovy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 '18 at 14:06









      Szymon Stepniak

      17.5k83364




      17.5k83364










      asked Nov 19 '18 at 11:24









      Samuel GIFFARDSamuel GIFFARD

      388112




      388112
























          2 Answers
          2






          active

          oldest

          votes


















          0














          You can't achieve expected behavior with MockFor class. Ignoring main method has one significant effect - inner method myFunction gets executed, but it happens without a presence of MockInterceptor. You can put a breakpoint in groovy.mock.MockProxyMetaClass class in the beginning of invokeMethod (line 74) and run a debugger to see what happens.



          public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
          if (null == interceptor && !fallingThrough) {
          throw new RuntimeException("cannot invoke method '" + methodName + "' without interceptor");
          }
          Object result = FALL_THROUGH_MARKER;
          if (interceptor != null) {
          result = interceptor.beforeInvoke(object, methodName, arguments);
          }
          if (result == FALL_THROUGH_MARKER) {
          Interceptor saved = interceptor;
          interceptor = null;
          boolean savedFallingThrough = fallingThrough;
          fallingThrough = true;
          result = adaptee.invokeMethod(object, methodName, arguments);
          fallingThrough = savedFallingThrough;
          interceptor = saved;
          }
          return result;
          }


          Invoking foo.main() method in the mock.use {} block invokes this method for non-null interceptor. The result returned by interceptor.beforeInvoke() is equal to FALL_THROUGH_MARKER because main method is marked as ignored. In this case interceptor is set to null temporarily and the method gets invoked in a regular way - it invokes inner myFunction method, but this fact is not recorded due to null interceptor at this point.



          Basically, you treat mock object in your test case not as a mock, but rather as a spy object. Groovy standard mocking library does not support spy objects, but you can use e.g. Spock Framework to write tests using spy objects. The test you have shown in the question could look like this using Spock:



          import spock.lang.Specification

          class ExampleSpec extends Specification {

          static class MyClass {
          def main() {
          return myFunction(0, 0 ,0)
          }

          def myFunction(def a, def b, def c) {
          return '2'
          }
          }

          def "should call myFunction with specific parameters"() {
          given:
          def foo = Spy(MyClass)

          when:
          foo.main()

          then:
          1 * foo.myFunction(0, 0, 0)

          and:
          0 * foo.myFunction(1,0,0)
          }
          }


          It executes a real foo.main() method, but it mocks foo.myFunction() method and records invocations and tests if the method got invoked with correct parameters - it records that it got invoked once with parameters (0, 0, 0) and that it was not invoked with parameters (1, 0, 0).



          IMPORTANT: If you create mock/spy objects from classes and not interfaces, then you need to add cglib-nodep dependency together with Spock.






          share|improve this answer
























          • Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

            – Samuel GIFFARD
            Nov 19 '18 at 16:06











          • Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

            – billjamesdev
            Nov 19 '18 at 22:10



















          0














          Okay, this is doable as mock.demand.myFunction takes a normal Closure.
          I ended up with something like this:



          import groovy.mock.interceptor.MockFor
          import org.junit.Test

          class MyClassTest extends GroovyTestCase {
          @Test
          void test_correctness_of_passed_arguments() {
          def mock = new MockFor(MyClass)
          mock.ignore('main')
          def res =
          // the mocked function stores its values in `res` and returns '0'
          mock.demand.myFunction(4) {a, b, c ->
          res.add([a, b, c])
          '0'
          }
          mock.use {
          def foo = new MyClass()
          foo.main() // <--- this is in there that it gets executed
          }
          mock.expect.verify()
          res[0] // <--- I can then access the values there
          }
          }


          In the above example, I request myFunction to be called 4 times.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373609%2fcheck-the-input-parameters-with-groovy-mock-interceptor%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can't achieve expected behavior with MockFor class. Ignoring main method has one significant effect - inner method myFunction gets executed, but it happens without a presence of MockInterceptor. You can put a breakpoint in groovy.mock.MockProxyMetaClass class in the beginning of invokeMethod (line 74) and run a debugger to see what happens.



            public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
            if (null == interceptor && !fallingThrough) {
            throw new RuntimeException("cannot invoke method '" + methodName + "' without interceptor");
            }
            Object result = FALL_THROUGH_MARKER;
            if (interceptor != null) {
            result = interceptor.beforeInvoke(object, methodName, arguments);
            }
            if (result == FALL_THROUGH_MARKER) {
            Interceptor saved = interceptor;
            interceptor = null;
            boolean savedFallingThrough = fallingThrough;
            fallingThrough = true;
            result = adaptee.invokeMethod(object, methodName, arguments);
            fallingThrough = savedFallingThrough;
            interceptor = saved;
            }
            return result;
            }


            Invoking foo.main() method in the mock.use {} block invokes this method for non-null interceptor. The result returned by interceptor.beforeInvoke() is equal to FALL_THROUGH_MARKER because main method is marked as ignored. In this case interceptor is set to null temporarily and the method gets invoked in a regular way - it invokes inner myFunction method, but this fact is not recorded due to null interceptor at this point.



            Basically, you treat mock object in your test case not as a mock, but rather as a spy object. Groovy standard mocking library does not support spy objects, but you can use e.g. Spock Framework to write tests using spy objects. The test you have shown in the question could look like this using Spock:



            import spock.lang.Specification

            class ExampleSpec extends Specification {

            static class MyClass {
            def main() {
            return myFunction(0, 0 ,0)
            }

            def myFunction(def a, def b, def c) {
            return '2'
            }
            }

            def "should call myFunction with specific parameters"() {
            given:
            def foo = Spy(MyClass)

            when:
            foo.main()

            then:
            1 * foo.myFunction(0, 0, 0)

            and:
            0 * foo.myFunction(1,0,0)
            }
            }


            It executes a real foo.main() method, but it mocks foo.myFunction() method and records invocations and tests if the method got invoked with correct parameters - it records that it got invoked once with parameters (0, 0, 0) and that it was not invoked with parameters (1, 0, 0).



            IMPORTANT: If you create mock/spy objects from classes and not interfaces, then you need to add cglib-nodep dependency together with Spock.






            share|improve this answer
























            • Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

              – Samuel GIFFARD
              Nov 19 '18 at 16:06











            • Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

              – billjamesdev
              Nov 19 '18 at 22:10
















            0














            You can't achieve expected behavior with MockFor class. Ignoring main method has one significant effect - inner method myFunction gets executed, but it happens without a presence of MockInterceptor. You can put a breakpoint in groovy.mock.MockProxyMetaClass class in the beginning of invokeMethod (line 74) and run a debugger to see what happens.



            public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
            if (null == interceptor && !fallingThrough) {
            throw new RuntimeException("cannot invoke method '" + methodName + "' without interceptor");
            }
            Object result = FALL_THROUGH_MARKER;
            if (interceptor != null) {
            result = interceptor.beforeInvoke(object, methodName, arguments);
            }
            if (result == FALL_THROUGH_MARKER) {
            Interceptor saved = interceptor;
            interceptor = null;
            boolean savedFallingThrough = fallingThrough;
            fallingThrough = true;
            result = adaptee.invokeMethod(object, methodName, arguments);
            fallingThrough = savedFallingThrough;
            interceptor = saved;
            }
            return result;
            }


            Invoking foo.main() method in the mock.use {} block invokes this method for non-null interceptor. The result returned by interceptor.beforeInvoke() is equal to FALL_THROUGH_MARKER because main method is marked as ignored. In this case interceptor is set to null temporarily and the method gets invoked in a regular way - it invokes inner myFunction method, but this fact is not recorded due to null interceptor at this point.



            Basically, you treat mock object in your test case not as a mock, but rather as a spy object. Groovy standard mocking library does not support spy objects, but you can use e.g. Spock Framework to write tests using spy objects. The test you have shown in the question could look like this using Spock:



            import spock.lang.Specification

            class ExampleSpec extends Specification {

            static class MyClass {
            def main() {
            return myFunction(0, 0 ,0)
            }

            def myFunction(def a, def b, def c) {
            return '2'
            }
            }

            def "should call myFunction with specific parameters"() {
            given:
            def foo = Spy(MyClass)

            when:
            foo.main()

            then:
            1 * foo.myFunction(0, 0, 0)

            and:
            0 * foo.myFunction(1,0,0)
            }
            }


            It executes a real foo.main() method, but it mocks foo.myFunction() method and records invocations and tests if the method got invoked with correct parameters - it records that it got invoked once with parameters (0, 0, 0) and that it was not invoked with parameters (1, 0, 0).



            IMPORTANT: If you create mock/spy objects from classes and not interfaces, then you need to add cglib-nodep dependency together with Spock.






            share|improve this answer
























            • Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

              – Samuel GIFFARD
              Nov 19 '18 at 16:06











            • Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

              – billjamesdev
              Nov 19 '18 at 22:10














            0












            0








            0







            You can't achieve expected behavior with MockFor class. Ignoring main method has one significant effect - inner method myFunction gets executed, but it happens without a presence of MockInterceptor. You can put a breakpoint in groovy.mock.MockProxyMetaClass class in the beginning of invokeMethod (line 74) and run a debugger to see what happens.



            public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
            if (null == interceptor && !fallingThrough) {
            throw new RuntimeException("cannot invoke method '" + methodName + "' without interceptor");
            }
            Object result = FALL_THROUGH_MARKER;
            if (interceptor != null) {
            result = interceptor.beforeInvoke(object, methodName, arguments);
            }
            if (result == FALL_THROUGH_MARKER) {
            Interceptor saved = interceptor;
            interceptor = null;
            boolean savedFallingThrough = fallingThrough;
            fallingThrough = true;
            result = adaptee.invokeMethod(object, methodName, arguments);
            fallingThrough = savedFallingThrough;
            interceptor = saved;
            }
            return result;
            }


            Invoking foo.main() method in the mock.use {} block invokes this method for non-null interceptor. The result returned by interceptor.beforeInvoke() is equal to FALL_THROUGH_MARKER because main method is marked as ignored. In this case interceptor is set to null temporarily and the method gets invoked in a regular way - it invokes inner myFunction method, but this fact is not recorded due to null interceptor at this point.



            Basically, you treat mock object in your test case not as a mock, but rather as a spy object. Groovy standard mocking library does not support spy objects, but you can use e.g. Spock Framework to write tests using spy objects. The test you have shown in the question could look like this using Spock:



            import spock.lang.Specification

            class ExampleSpec extends Specification {

            static class MyClass {
            def main() {
            return myFunction(0, 0 ,0)
            }

            def myFunction(def a, def b, def c) {
            return '2'
            }
            }

            def "should call myFunction with specific parameters"() {
            given:
            def foo = Spy(MyClass)

            when:
            foo.main()

            then:
            1 * foo.myFunction(0, 0, 0)

            and:
            0 * foo.myFunction(1,0,0)
            }
            }


            It executes a real foo.main() method, but it mocks foo.myFunction() method and records invocations and tests if the method got invoked with correct parameters - it records that it got invoked once with parameters (0, 0, 0) and that it was not invoked with parameters (1, 0, 0).



            IMPORTANT: If you create mock/spy objects from classes and not interfaces, then you need to add cglib-nodep dependency together with Spock.






            share|improve this answer













            You can't achieve expected behavior with MockFor class. Ignoring main method has one significant effect - inner method myFunction gets executed, but it happens without a presence of MockInterceptor. You can put a breakpoint in groovy.mock.MockProxyMetaClass class in the beginning of invokeMethod (line 74) and run a debugger to see what happens.



            public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
            if (null == interceptor && !fallingThrough) {
            throw new RuntimeException("cannot invoke method '" + methodName + "' without interceptor");
            }
            Object result = FALL_THROUGH_MARKER;
            if (interceptor != null) {
            result = interceptor.beforeInvoke(object, methodName, arguments);
            }
            if (result == FALL_THROUGH_MARKER) {
            Interceptor saved = interceptor;
            interceptor = null;
            boolean savedFallingThrough = fallingThrough;
            fallingThrough = true;
            result = adaptee.invokeMethod(object, methodName, arguments);
            fallingThrough = savedFallingThrough;
            interceptor = saved;
            }
            return result;
            }


            Invoking foo.main() method in the mock.use {} block invokes this method for non-null interceptor. The result returned by interceptor.beforeInvoke() is equal to FALL_THROUGH_MARKER because main method is marked as ignored. In this case interceptor is set to null temporarily and the method gets invoked in a regular way - it invokes inner myFunction method, but this fact is not recorded due to null interceptor at this point.



            Basically, you treat mock object in your test case not as a mock, but rather as a spy object. Groovy standard mocking library does not support spy objects, but you can use e.g. Spock Framework to write tests using spy objects. The test you have shown in the question could look like this using Spock:



            import spock.lang.Specification

            class ExampleSpec extends Specification {

            static class MyClass {
            def main() {
            return myFunction(0, 0 ,0)
            }

            def myFunction(def a, def b, def c) {
            return '2'
            }
            }

            def "should call myFunction with specific parameters"() {
            given:
            def foo = Spy(MyClass)

            when:
            foo.main()

            then:
            1 * foo.myFunction(0, 0, 0)

            and:
            0 * foo.myFunction(1,0,0)
            }
            }


            It executes a real foo.main() method, but it mocks foo.myFunction() method and records invocations and tests if the method got invoked with correct parameters - it records that it got invoked once with parameters (0, 0, 0) and that it was not invoked with parameters (1, 0, 0).



            IMPORTANT: If you create mock/spy objects from classes and not interfaces, then you need to add cglib-nodep dependency together with Spock.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 19 '18 at 14:06









            Szymon StepniakSzymon Stepniak

            17.5k83364




            17.5k83364













            • Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

              – Samuel GIFFARD
              Nov 19 '18 at 16:06











            • Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

              – billjamesdev
              Nov 19 '18 at 22:10



















            • Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

              – Samuel GIFFARD
              Nov 19 '18 at 16:06











            • Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

              – billjamesdev
              Nov 19 '18 at 22:10

















            Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

            – Samuel GIFFARD
            Nov 19 '18 at 16:06





            Thanks for your time and explanation. I found Spock-related answers before, but I want to avoid using external libraries. :-) (not sure why you removed my "thanks" message in my initial question, though...)

            – Samuel GIFFARD
            Nov 19 '18 at 16:06













            Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

            – billjamesdev
            Nov 19 '18 at 22:10





            Here's why thanks was removed: meta.stackexchange.com/questions/2950/…

            – billjamesdev
            Nov 19 '18 at 22:10













            0














            Okay, this is doable as mock.demand.myFunction takes a normal Closure.
            I ended up with something like this:



            import groovy.mock.interceptor.MockFor
            import org.junit.Test

            class MyClassTest extends GroovyTestCase {
            @Test
            void test_correctness_of_passed_arguments() {
            def mock = new MockFor(MyClass)
            mock.ignore('main')
            def res =
            // the mocked function stores its values in `res` and returns '0'
            mock.demand.myFunction(4) {a, b, c ->
            res.add([a, b, c])
            '0'
            }
            mock.use {
            def foo = new MyClass()
            foo.main() // <--- this is in there that it gets executed
            }
            mock.expect.verify()
            res[0] // <--- I can then access the values there
            }
            }


            In the above example, I request myFunction to be called 4 times.






            share|improve this answer




























              0














              Okay, this is doable as mock.demand.myFunction takes a normal Closure.
              I ended up with something like this:



              import groovy.mock.interceptor.MockFor
              import org.junit.Test

              class MyClassTest extends GroovyTestCase {
              @Test
              void test_correctness_of_passed_arguments() {
              def mock = new MockFor(MyClass)
              mock.ignore('main')
              def res =
              // the mocked function stores its values in `res` and returns '0'
              mock.demand.myFunction(4) {a, b, c ->
              res.add([a, b, c])
              '0'
              }
              mock.use {
              def foo = new MyClass()
              foo.main() // <--- this is in there that it gets executed
              }
              mock.expect.verify()
              res[0] // <--- I can then access the values there
              }
              }


              In the above example, I request myFunction to be called 4 times.






              share|improve this answer


























                0












                0








                0







                Okay, this is doable as mock.demand.myFunction takes a normal Closure.
                I ended up with something like this:



                import groovy.mock.interceptor.MockFor
                import org.junit.Test

                class MyClassTest extends GroovyTestCase {
                @Test
                void test_correctness_of_passed_arguments() {
                def mock = new MockFor(MyClass)
                mock.ignore('main')
                def res =
                // the mocked function stores its values in `res` and returns '0'
                mock.demand.myFunction(4) {a, b, c ->
                res.add([a, b, c])
                '0'
                }
                mock.use {
                def foo = new MyClass()
                foo.main() // <--- this is in there that it gets executed
                }
                mock.expect.verify()
                res[0] // <--- I can then access the values there
                }
                }


                In the above example, I request myFunction to be called 4 times.






                share|improve this answer













                Okay, this is doable as mock.demand.myFunction takes a normal Closure.
                I ended up with something like this:



                import groovy.mock.interceptor.MockFor
                import org.junit.Test

                class MyClassTest extends GroovyTestCase {
                @Test
                void test_correctness_of_passed_arguments() {
                def mock = new MockFor(MyClass)
                mock.ignore('main')
                def res =
                // the mocked function stores its values in `res` and returns '0'
                mock.demand.myFunction(4) {a, b, c ->
                res.add([a, b, c])
                '0'
                }
                mock.use {
                def foo = new MyClass()
                foo.main() // <--- this is in there that it gets executed
                }
                mock.expect.verify()
                res[0] // <--- I can then access the values there
                }
                }


                In the above example, I request myFunction to be called 4 times.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 19 '18 at 16:04









                Samuel GIFFARDSamuel GIFFARD

                388112




                388112






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373609%2fcheck-the-input-parameters-with-groovy-mock-interceptor%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini