@Bean
 GameUpdateService patchService() {
   if (environment.containsProperty("disable.update")) {
     return new MockGameUpdateService();
   }
   return new GameUpdateServiceImpl();
 }
 @Bean
 GravatarService gravatarService() {
   if (environment.containsProperty("faf.testing")) {
     return new MockGravatarService();
   }
   return new GravatarServiceImpl();
 }
 @Bean
 LeaderboardService leaderboardService() {
   if (environment.containsProperty("faf.testing")) {
     return new MockLeaderboardService();
   }
   return new LeaderboardServiceImpl();
 }
 @Bean
 ChatService chatService() {
   if (environment.containsProperty("faf.testing")) {
     return new MockChatService();
   }
   return new PircBotXChatService();
 }
 @Bean
 StatisticsServerAccessor statisticsServerAccessor() {
   if (environment.containsProperty("faf.testing")) {
     return new MockStatisticsServerAccessor();
   }
   return new StatisticsServerAccessorImpl();
 }
 @Bean
 FafApiAccessor fafApiAccessor() {
   if (environment.containsProperty("faf.testing")) {
     return new MockFafApiAccessor();
   }
   return new FafApiAccessorImpl();
 }
 @Bean
 ClientUpdateService updateService() {
   if (environment.containsProperty("faf.testing")) {
     return new MockClientUpdateService();
   } else {
     return new ClientUpdateServiceImpl();
   }
 }
  @Bean
  CustomerRealmWebService customerRealmWebService(
      Environment environment,
      AccessTokens accessTokens,
      CustomerRealmProperties customerRealmProperties) {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setAddress(customerRealmProperties.getServiceUrl());
    factory.setServiceClass(CustomerRealmWebService.class);
    OAuth2TokenInterceptor oAuth2TokenInterceptor =
        new OAuth2TokenInterceptor(accessTokens, SERVICE_ID);
    factory.getOutInterceptors().add(oAuth2TokenInterceptor);

    if (environment.containsProperty("debug") || environment.containsProperty("trace")) {
      LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
      loggingInInterceptor.setPrettyLogging(true);
      LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
      loggingOutInterceptor.setPrettyLogging(true);
      factory.getInInterceptors().add(loggingInInterceptor);
      factory.getOutInterceptors().add(loggingOutInterceptor);
    }

    return (CustomerRealmWebService) factory.create();
  }