public static void main(String[] args) {
/* Get service object. */
ApplicationContext ctx = new ClassPathXmlApplicationContext(
new String[] { SPRING_CONFIG_FILE, SPRING_CONFIG_TEST_FILE });
UserService userService = ctx.getBean(UserService.class);
try {
// Register user.
User userProfile = userService.registerUser("userPassword",
new UserDetails("name", "lastName", "user@udc.es", "user"));
System.out.println("User with userId '" + userProfile.getUserId()
+ "' has been created");
System.out.println(userProfile);
// Find user.
userProfile = userService.login("serviceUser", "userPassword",
false);
System.out.println("User with userId '" + userProfile.getUserId()
+ "' has been retrieved");
System.out.println(userProfile);