From f0ded6a91f804a2006c610599a9a7d926bf5bc6f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 11 Oct 2011 23:32:10 +0000 Subject: [PATCH] [SPR-8401] Added missing TransferServiceConfig code listing. --- spring-framework-reference/src/testing.xml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/spring-framework-reference/src/testing.xml b/spring-framework-reference/src/testing.xml index b8f8db578a..c7c92f4fc7 100644 --- a/spring-framework-reference/src/testing.xml +++ b/spring-framework-reference/src/testing.xml @@ -1491,14 +1491,26 @@ public class JndiDataConfig { } @Configuration -@Profile("production") -public class JndiDataConfig { +public class TransferServiceConfig { + + @Autowired DataSource dataSource; @Bean - public DataSource dataSource() throws Exception { - Context ctx = new InitialContext(); - return (DataSource) ctx.lookup("java:comp/env/jdbc/datasource"); + public TransferService transferService() { + return new DefaultTransferService(accountRepository(), + feePolicy()); } + + @Bean + public AccountRepository accountRepository() { + return new JdbcAccountRepository(dataSource); + } + + @Bean + public FeePolicy feePolicy() { + return new ZeroFeePolicy(); + } + } package com.bank.service;