com.freemanan.starter.grpc.extensions.test.GrpcPortBeanPostProcessor Maven / Gradle / Ivy
package com.freemanan.starter.grpc.extensions.test;
import com.freemanan.starter.grpc.server.GrpcServerStartedEvent;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.ReflectionUtils;
/**
* @author Freeman
*/
class GrpcPortBeanPostProcessor implements ApplicationListener, BeanPostProcessor {
/**
* key: bean instance, value: whether injected port
*/
private final Map