JedisConstructorWithShardInfoArgInterceptor implements InstanceConstructorInterceptor { @Override public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { String redisConnInfo; JedisShardInfo shardInfo = (JedisShardInfo) allArguments[0]; redisConnInfo = shardInfo.getHost() + ":" + shardInfo.getPort(); objInst.setSkyWalkingDynamicField(redisConnInfo); }  @Override void onConstruct(EnhancedInstance objInst, Object[] allArguments);  }
@Test public void onConstruct() throws Exception { interceptor.onConstruct(enhancedInstance, new Object[] {new JedisShardInfo("127.0.0.1", 6379)}); verify(enhancedInstance).setSkyWalkingDynamicField("127.0.0.1:6379"); }