### Question:
GCPBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; setHadoopConfiguration(baseConf); return baseConf; } return bean; } @Autowired  GCPBeanPostProcessor(
      GCPCredentialPathProvider credentialPathProvider,
      DistributedFileSystemPathProvider dfsPathProvider,
      BindGoogleHadoopFileSystem bindGoogleHadoopFileSystem,
      FileSystemFactory fileSystemFactory,
      GCPCredentialCopier credentialCopier); @Override Object postProcessBeforeInitialization(Object bean, String beanName); @Override Object postProcessAfterInitialization(Object bean, String beanName);  }### Answer:
@Test public void postProcessAfterInitializationWithIncorrectBeanName() throws Exception { String beanName = "notBaseConf"; processor.postProcessAfterInitialization(configuration, beanName); verifyZeroInteractions(credentialPathProvider, bindGoogleHadoopFileSystem, credentialCopier); }
@Test public void postProcessAfterInitializationWithConfigurationBeanProviderPathIsNotNull() throws Exception { String beanName = CommonBeans.BEAN_BASE_CONF; when(credentialPathProvider.newPath()).thenReturn(new Path("/test.json")); when(fileSystemFactory.getFileSystem(configuration)).thenReturn(fileSystem); processor.postProcessAfterInitialization(configuration, beanName); verify(bindGoogleHadoopFileSystem).bindFileSystem(configuration); verify(credentialCopier) .copyCredentials(fileSystem, configuration, credentialPathProvider, distributedFileSystemPathProvider); }
@Test public void postProcessAfterInitializationWithConfigurationBeanProviderPathIsNull() throws Exception { String beanName = CommonBeans.BEAN_BASE_CONF; when(credentialPathProvider.newPath()).thenReturn(null); processor.postProcessAfterInitialization(configuration, beanName); verifyZeroInteractions(bindGoogleHadoopFileSystem, credentialCopier, fileSystemFactory); }