Fix rest sample tests

- move to itest folder
- dynamically allocate the port for Redis

Issues gh-183
This commit is contained in:
Rob Winch
2015-04-09 14:28:12 -05:00
parent 3a42147d3e
commit 88151b4287
4 changed files with 53 additions and 7 deletions

View File

@@ -15,6 +15,7 @@
*/
package sample;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@@ -30,8 +31,10 @@ import org.springframework.session.web.http.HttpSessionStrategy;
public class HttpSessionConfig {
@Bean
public JedisConnectionFactory connectionFactory() {
return new JedisConnectionFactory(); // <3>
public JedisConnectionFactory connectionFactory(@Value("${redis.server.port}") int port) {
JedisConnectionFactory factory = new JedisConnectionFactory(); // <3>
factory.setPort(port);
return factory;
}
@Bean