CreatePreparedStatementInterceptor implements InstanceMethodsAroundInterceptor { @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable { if (ret instanceof EnhancedInstance) { ((EnhancedInstance) ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo) objInst.getSkyWalkingDynamicField(), (String) allArguments[0], "PreparedStatement")); } return ret; }  @Override void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        MethodInterceptResult result); @Override Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        Object ret); @Override void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
        Class<?>[] argumentsTypes, Throwable t);  }
@Test public void testResultIsEnhanceInstance() throws Throwable { interceptor.afterMethod(objectInstance, null, new Object[] {"SELECT * FROM test"}, null, ret); verify(ret).setSkyWalkingDynamicField(Matchers.any()); }
@Test public void testResultIsNotEnhanceInstance() throws Throwable { interceptor.afterMethod(objectInstance, null, new Object[] {"SELECT * FROM test"}, null, new Object()); verify(ret, times(0)).setSkyWalkingDynamicField(Matchers.any()); }