spock icon indicating copy to clipboard operation
spock copied to clipboard

Call invocation.proceed() by default in abstract method interceptor

Open rtretyak opened this issue 6 years ago • 2 comments

I find it strange to use AbstractMethodInterceptor without the default invocation.proceed() behavior. This way I can only override the desired method(s) and don't worry that the whole spock execution will be ruined when using foo.addInterceptor(...).


This change is Reviewable

rtretyak avatar Aug 19 '19 11:08 rtretyak

Codecov Report

Merging #1012 into master will decrease coverage by 0.08%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #1012      +/-   ##
===========================================
- Coverage     75.99%   75.9%   -0.09%     
  Complexity     3544    3544              
===========================================
  Files           377     377              
  Lines         10788   10800      +12     
  Branches       1374    1374              
===========================================
  Hits           8198    8198              
- Misses         2109    2121      +12     
  Partials        481     481
Impacted Files Coverage Δ Complexity Δ
...k/runtime/extension/AbstractMethodInterceptor.java 36.53% <0%> (-10.97%) 9 <8> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d751a0a...38a4c8d. Read the comment docs.

codecov[bot] avatar Aug 19 '19 11:08 codecov[bot]

While it might avoid an issue, in retrospect it would have been better to throw an OperationNotSupportedException by default, since you should only register the Interceptors to where you need them. It actually is faster if there are no interceptors registered for a given extension point. And when you need it, then you'll also implement the respective function.

leonard84 avatar Jan 12 '20 20:01 leonard84