### Question:
NarayanaConfiguration { @Bean @ConditionalOnMissingBean public JtaTransactionManager transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry) { JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, transactionManager); jtaTransactionManager.setTransactionSynchronizationRegistry(transactionSynchronizationRegistry); if (this.transactionManagerCustomizers != null) { this.transactionManagerCustomizers.customize(jtaTransactionManager); } return jtaTransactionManager; } NarayanaConfiguration(JtaProperties jtaProperties,
            ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers); @Bean @ConditionalOnMissingBean static NarayanaBeanFactoryPostProcessor narayanaBeanFactoryPostProcessor(); @Bean @ConditionalOnMissingBean NarayanaPropertiesInitializer narayanaPropertiesInitializer(NarayanaProperties properties); @Bean @DependsOn("narayanaPropertiesInitializer") @ConditionalOnMissingBean UserTransaction narayanaUserTransaction(); @Bean @DependsOn("narayanaPropertiesInitializer") @ConditionalOnMissingBean TransactionManager narayanaTransactionManager(); @Bean @DependsOn("narayanaPropertiesInitializer") @ConditionalOnMissingBean TransactionSynchronizationRegistry narayanaTransactionSynchronizationRegistry(); @Bean @ConditionalOnMissingBean JtaTransactionManager transactionManager(UserTransaction userTransaction,
            TransactionManager transactionManager,
            TransactionSynchronizationRegistry transactionSynchronizationRegistry); @Bean(destroyMethod = "stop") @DependsOn("narayanaPropertiesInitializer") @ConditionalOnMissingBean RecoveryManagerService recoveryManagerService(); @Bean @DependsOn("recoveryManagerService") @ConditionalOnMissingBean XARecoveryModule xaRecoveryModule();  }### Answer:
@Test public void jtaTransactionManagerShouldBeCreated() { JtaTransactionManager jtaTransactionManager = this.configuration.transactionManager( this.mockUserTransaction, this.mockTransactionManager, this.mockTransactionSynchronizationRegistry); assertThat(jtaTransactionManager.getUserTransaction()).isEqualTo(this.mockUserTransaction); assertThat(jtaTransactionManager.getTransactionManager()).isEqualTo(this.mockTransactionManager); assertThat(jtaTransactionManager.getTransactionSynchronizationRegistry()) .isEqualTo(this.mockTransactionSynchronizationRegistry); }
@Test public void jtaTransactionManagerShouldBeCustomized() { given(this.mockTransactionManagerCustomizersProvider.getIfAvailable()).willReturn( this.mockTransactionManagerCustomizers); this.configuration = new NarayanaConfiguration(this.mockJtaProperties, this.mockTransactionManagerCustomizersProvider); JtaTransactionManager jtaTransactionManager = this.configuration.transactionManager( this.mockUserTransaction, this.mockTransactionManager, this.mockTransactionSynchronizationRegistry); verify(this.mockTransactionManagerCustomizers).customize(jtaTransactionManager); }