// Path: spring-data-solr-demo-jaxrs/src/main/java/org/tuxdevelop/spring/data/solr/demo/StarbucksJaxRSApplication.java
// @SpringBootApplication
// @EnableSolrRepositories(basePackages = "org.tuxdevelop.spring.data.solr.demo.repository")
// public class StarbucksJaxRSApplication {
// 
//     @Autowired
//     private SolrInitializer solrInitializer;
// 
//     public static void main(final String[] args) {
//         SpringApplication.run(StarbucksJaxRSApplication.class, args);
//     }
// 
//     @PostConstruct
//     public void init() throws Exception {
//         solrInitializer.importStarbucks();
//     }
// 
// 
// }
// 
// Path: spring-data-solr-demo-jaxrs/src/main/java/org/tuxdevelop/spring/data/solr/demo/api/StoreService.java
// @Path("/stores")
// public interface StoreService {
// 
//     String SEARCH = "/search";
// 
//     @POST
//     @Path("/")
//     @Produces("application/json")
//     @Consumes("application/json")
//     StarbucksStore add(final StarbucksStore starbucksStore);
// 
//     @GET
//     @Path("/{id}")
//     @Produces("application/json")
//     StarbucksStore get(@PathParam("id") String id);
// 
//     @DELETE
//     @Path("/{id}")
//     void delete(@PathParam("id") final String id);
// 
//     @GET
//     @Path(SEARCH + "/byName")
//     @Produces("application/json")
//     Collection<StarbucksStore> findByName(@QueryParam("name") final String name);
// 
//     @GET
//     @Path(SEARCH + "/near")
//     @Produces("application/json")
//     Collection<StarbucksStore> findNear(@QueryParam("longtitude") final Double longtitude,
//                                @QueryParam("latitude") final Double latitude,
//                                @QueryParam("distance") final Double distance,
//                                @QueryParam("products") final List<String> products);
// 
// }


import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.proxy.WebResourceFactory;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.tuxdevelop.spring.data.solr.demo.StarbucksJaxRSApplication;
import org.tuxdevelop.spring.data.solr.demo.api.StoreService;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
package org.tuxdevelop.spring.data.solr.demo.configuration;



@Configuration
@ComponentScan(excludeFilters = {@ComponentScan.Filter(value = StarbucksJaxRSApplication.class, type = FilterType
        .ASSIGNABLE_TYPE), @ComponentScan.Filter(value = ITConfiguration.class, type = FilterType.ASSIGNABLE_TYPE),
        @ComponentScan.Filter(value = SolrConfiguration.class, type = FilterType.ASSIGNABLE_TYPE)})
public class SystemITConfiguration {

    private static final String PORT = "9011";

    @Bean
    public StoreService storeService() {
        final ClientConfig cc = new ClientConfig();
        final Client client = ClientBuilder.newClient(cc);
        client.register(new JacksonFeature());
// Path: spring-data-solr-demo-jaxrs/src/main/java/org/tuxdevelop/spring/data/solr/demo/StarbucksJaxRSApplication.java
// @SpringBootApplication
// @EnableSolrRepositories(basePackages = "org.tuxdevelop.spring.data.solr.demo.repository")
// public class StarbucksJaxRSApplication {
// 
//     @Autowired
//     private SolrInitializer solrInitializer;
// 
//     public static void main(final String[] args) {
//         SpringApplication.run(StarbucksJaxRSApplication.class, args);
//     }
// 
//     @PostConstruct
//     public void init() throws Exception {
//         solrInitializer.importStarbucks();
//     }
// 
// 
// }
// 
// Path: spring-data-solr-demo-jaxrs/src/main/java/org/tuxdevelop/spring/data/solr/demo/api/StoreService.java
// @Path("/stores")
// public interface StoreService {
// 
//     String SEARCH = "/search";
// 
//     @POST
//     @Path("/")
//     @Produces("application/json")
//     @Consumes("application/json")
//     StarbucksStore add(final StarbucksStore starbucksStore);
// 
//     @GET
//     @Path("/{id}")
//     @Produces("application/json")
//     StarbucksStore get(@PathParam("id") String id);
// 
//     @DELETE
//     @Path("/{id}")
//     void delete(@PathParam("id") final String id);
// 
//     @GET
//     @Path(SEARCH + "/byName")
//     @Produces("application/json")
//     Collection<StarbucksStore> findByName(@QueryParam("name") final String name);
// 
//     @GET
//     @Path(SEARCH + "/near")
//     @Produces("application/json")
//     Collection<StarbucksStore> findNear(@QueryParam("longtitude") final Double longtitude,
//                                @QueryParam("latitude") final Double latitude,
//                                @QueryParam("distance") final Double distance,
//                                @QueryParam("products") final List<String> products);
// 
// }


// Path: spring-data-solr-demo-jaxrs/src/test/java/org/tuxdevelop/spring/data/solr/demo/configuration/SystemITConfiguration.java
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.proxy.WebResourceFactory;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.tuxdevelop.spring.data.solr.demo.StarbucksJaxRSApplication;
import org.tuxdevelop.spring.data.solr.demo.api.StoreService;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

package org.tuxdevelop.spring.data.solr.demo.configuration;



@Configuration
@ComponentScan(excludeFilters = {@ComponentScan.Filter(value = StarbucksJaxRSApplication.class, type = FilterType
        .ASSIGNABLE_TYPE), @ComponentScan.Filter(value = ITConfiguration.class, type = FilterType.ASSIGNABLE_TYPE),
        @ComponentScan.Filter(value = SolrConfiguration.class, type = FilterType.ASSIGNABLE_TYPE)})
public class SystemITConfiguration {

    private static final String PORT = "9011";

    @Bean
    public StoreService storeService() {
        final ClientConfig cc = new ClientConfig();
        final Client client = ClientBuilder.newClient(cc);
        client.register(new JacksonFeature());
        final WebTarget target = client.target("http://localhost:" + PORT + "/dataSolr/api");