Skip to content

Commit 3260c94

Browse files
author
vsgamb
committed
Comments Addressing
1 parent 0e715b1 commit 3260c94

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

tef-impl/src/main/java/flipkart/tef/bizlogics/DataAdapterBizlogic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ private Map<DataAdapterKey<?>, Field> buildCacheOfMutableFields() {
8282

8383
@SuppressWarnings("rawtypes")
8484
public static String getEmittedDataName(Class<? extends DataAdapterBizlogic> clazz) {
85+
// If method interceptor is applied via guice AOP , then guice creates an instance wrapped by EnhancerByGuice
86+
// and then it hinders any annotation present on the superclass. So extracting superclass to find the annotations.
8587
if (clazz.getName().contains(BytecodeGen.ENHANCER_BY_GUICE_MARKER)) {
8688
// If clazz is a guice proxy clazz , then Its super class will always be of type Class<? extends DataAdapterBizlogic>
8789
clazz = (Class<? extends DataAdapterBizlogic>) clazz.getSuperclass();

tef-impl/src/test/java/flipkart/tef/bizlogics/DataAdapterBizlogicTest.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
*Copyright [2024] [The Original Author]
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package flipkart.tef.bizlogics;
218

319
import com.google.inject.AbstractModule;
@@ -82,15 +98,8 @@ protected void configure() {
8298
public class CustomInterceptor implements MethodInterceptor {
8399
@Override
84100
public Object invoke(MethodInvocation invocation) throws Throwable {
85-
// Log method details before invocation
86-
System.out.println("Before test method invocation");
87-
88101
// Proceed with the actual method invocation
89-
Object result = invocation.proceed();
90-
91-
// Log method details after invocation
92-
System.out.println("After test method invocation");
93-
return result;
102+
return invocation.proceed();
94103
}
95104
}
96105
}

0 commit comments

Comments
 (0)