File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
main/java/org/seedstack/seed/core/internal
test/java/org/seedstack/seed/core Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 55 * License, v. 2.0. If a copy of the MPL was not distributed with this
66 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
77 */
8+
89package org .seedstack .seed .core .internal ;
910
1011import com .google .inject .AbstractModule ;
@@ -33,11 +34,12 @@ class CoreModule extends AbstractModule {
3334 protected void configure () {
3435 modules .forEach (this ::install );
3536 bindings .forEach (binding -> binding .apply (binder ()));
36- interceptors .forEach (interceptor -> bindInterceptor (
37- createMatcherFromPredicate (interceptor .classPredicate ()),
38- createMatcherFromPredicate (interceptor .methodPredicate ()),
39- interceptor
40- ));
37+ interceptors .forEach (interceptor -> {
38+ bindInterceptor (createMatcherFromPredicate (interceptor .classPredicate ()),
39+ createMatcherFromPredicate (interceptor .methodPredicate ()),
40+ interceptor );
41+ requestInjection (interceptor );
42+ });
4143 }
4244
4345 private <T > Matcher <T > createMatcherFromPredicate (Predicate <T > predicate ) {
Original file line number Diff line number Diff line change 55 * License, v. 2.0. If a copy of the MPL was not distributed with this
66 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
77 */
8+
89package org .seedstack .seed .core ;
910
1011import static org .assertj .core .api .Assertions .assertThat ;
2425import org .junit .Test ;
2526import org .junit .runner .RunWith ;
2627import org .seedstack .seed .Bind ;
27- import org .seedstack .seed .SeedInterceptor ;
2828import org .seedstack .seed .Logging ;
2929import org .seedstack .seed .Nullable ;
3030import org .seedstack .seed .SeedException ;
31+ import org .seedstack .seed .SeedInterceptor ;
3132import org .seedstack .seed .core .fixtures .BoundFromInterface ;
3233import org .seedstack .seed .core .fixtures .BoundFromInterfaceWithName ;
3334import org .seedstack .seed .core .fixtures .BoundFromItself ;
@@ -229,6 +230,8 @@ public void otherMethod() {
229230
230231 private static class SomeSeedInterceptor implements SeedInterceptor {
231232 static int invokedTimes = 0 ;
233+ @ Logging
234+ private Logger logger ;
232235
233236 @ Override
234237 public Predicate <Class <?>> classPredicate () {
@@ -242,6 +245,7 @@ public Predicate<Method> methodPredicate() {
242245
243246 @ Override
244247 public Object invoke (MethodInvocation invocation ) throws Throwable {
248+ assertThat (logger ).isNotNull ();
245249 invokedTimes ++;
246250 return invocation .proceed ();
247251 }
You can’t perform that action at this time.
0 commit comments