### Question:
NarayanaConfiguration { @Bean @ConditionalOnMissingBean public NarayanaPropertiesInitializer narayanaPropertiesInitializer(NarayanaProperties properties) { initLogDir(properties); initTransactionManagerId(properties); return new NarayanaPropertiesInitializer(properties); } 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 narayanaPropertiesInitializerShouldUseDefaultLogDir() { this.configuration.narayanaPropertiesInitializer(this.mockNarayanaProperties); File applicationHomeDir = new ApplicationHome().getDir(); File expectedLogDir = new File(applicationHomeDir, "transaction-logs"); verify(this.mockNarayanaProperties).setLogDir(expectedLogDir.getAbsolutePath()); }
@Test public void narayanaPropertiesInitializerShouldUseNarayanaTransactionManagerId() { given(this.mockNarayanaProperties.getTransactionManagerId()).willReturn("narayana-manager-id"); this.configuration.narayanaPropertiesInitializer(this.mockNarayanaProperties); verify(this.mockNarayanaProperties, times(0)).setTransactionManagerId(anyString()); }
@Test public void narayanaPropertiesInitializerShouldUseSpringJtaTransactionManagerId() { given(this.mockJtaProperties.getTransactionManagerId()).willReturn("spring-jta-manager-id"); this.configuration.narayanaPropertiesInitializer(this.mockNarayanaProperties); verify(this.mockNarayanaProperties).setTransactionManagerId("spring-jta-manager-id"); }