package com.hotent.assembly.mockmvc;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MockMvcBeanPostProcessor implements BeanPostProcessor {

	private final MockMvcFeignObjectWrapper mockMvcFeignObjectWrapper;

	public MockMvcBeanPostProcessor(MockMvcFeignObjectWrapper mockMvcFeignObjectWrapper) {
		this.mockMvcFeignObjectWrapper = mockMvcFeignObjectWrapper;
	}

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		return this.mockMvcFeignObjectWrapper.wrap(bean);
	}

}
