// Path: spring-data-solr-demo-common/src/main/java/org/tuxdevelop/spring/data/solr/demo/domain/StarbucksStore.java
// @Data
// @AllArgsConstructor
// @NoArgsConstructor
// @SolrDocument
// @XmlRootElement
// public class StarbucksStore {
// 
//     @Id
//     @Field("id")
//     private String id;
//     @Field("name")
//     private String name;
//     @Field("zipCode")
//     private String zipCode;
//     @Field("city")
//     private String city;
//     @Field("street")
//     private String street;
//     @Field("products")
//     private Collection<String> products;
//     @Field("services")
//     private Collection<String> services;
//     @JsonIgnore
//     @Field("location")
//     private Point location;
// 
// }


import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import org.tuxdevelop.spring.data.solr.demo.domain.StarbucksStore;
    protected static final String FIND_BY_NAME_QUERY = "/findByNameQuery";

    @Autowired
    private RestTemplate restTemplate;

    protected String baseUrl;

    @Test
    public void findByIdIT() {
        final Integer id = 1;
        final HttpEntity<?> httpEntity = getHttpEntity();
        final String uri = baseUrl + "/{id}";
        log.info("query url: " + uri);
        final ResponseEntity<StarbucksStore> response =
                restTemplate.exchange(uri, HttpMethod.GET, httpEntity,
                        StarbucksStore.class, id);
        System.out.println(response);
    }

    @Test
    public void findByNameIT() {
        final HttpEntity<?> httpEntity = getHttpEntity();
        final String url = baseUrl + SEARCH + FIND_BY_NAME;
        final UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder
                .fromHttpUrl(url)
                .queryParam("name", "Steaming Kettle");

        final String uri = uriComponentsBuilder.build().encode().toUriString();
        log.info("query url: " + uri);

// Path: spring-data-solr-demo-common/src/main/java/org/tuxdevelop/spring/data/solr/demo/domain/StarbucksStore.java
// @Data
// @AllArgsConstructor
// @NoArgsConstructor
// @SolrDocument
// @XmlRootElement
// public class StarbucksStore {
// 
//     @Id
//     @Field("id")
//     private String id;
//     @Field("name")
//     private String name;
//     @Field("zipCode")
//     private String zipCode;
//     @Field("city")
//     private String city;
//     @Field("street")
//     private String street;
//     @Field("products")
//     private Collection<String> products;
//     @Field("services")
//     private Collection<String> services;
//     @JsonIgnore
//     @Field("location")
//     private Point location;
// 
// }


// Path: spring-data-solr-demo-data-rest/src/test/java/org/tuxdevelop/spring/data/solr/demo/ITTests.java
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import org.tuxdevelop.spring.data.solr.demo.domain.StarbucksStore;

    protected static final String FIND_BY_NAME_QUERY = "/findByNameQuery";

    @Autowired
    private RestTemplate restTemplate;

    protected String baseUrl;

    @Test
    public void findByIdIT() {
        final Integer id = 1;
        final HttpEntity<?> httpEntity = getHttpEntity();
        final String uri = baseUrl + "/{id}";
        log.info("query url: " + uri);
        final ResponseEntity<StarbucksStore> response =
                restTemplate.exchange(uri, HttpMethod.GET, httpEntity,
                        StarbucksStore.class, id);
        System.out.println(response);
    }

    @Test
    public void findByNameIT() {
        final HttpEntity<?> httpEntity = getHttpEntity();
        final String url = baseUrl + SEARCH + FIND_BY_NAME;
        final UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder
                .fromHttpUrl(url)
                .queryParam("name", "Steaming Kettle");

        final String uri = uriComponentsBuilder.build().encode().toUriString();
        log.info("query url: " + uri);

        final ResponseEntity<StarbucksStore> response =